diff options
author | Rider Linden <rider@lindenlab.com> | 2015-09-16 15:04:57 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2015-09-16 15:04:57 -0700 |
commit | c7d5a4bab75b651b65e173a17079438f03695cc1 (patch) | |
tree | a4e8046e2232a4907a37eba0e95cca54b1a37a04 /indra/newview/lltwitterconnect.cpp | |
parent | fd27f0feb8ba4a2a8ac2b2c3b71bf71ab56aa42e (diff) |
MAINT-5628: Set flicr state to "Posting" on all paths before image upload starts. Causes "Upload" button to be disabled and activity indicator to appear. Also made sure that setConnectionState is called correctly for Facebook and Twitter.
Diffstat (limited to 'indra/newview/lltwitterconnect.cpp')
-rw-r--r-- | indra/newview/lltwitterconnect.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/indra/newview/lltwitterconnect.cpp b/indra/newview/lltwitterconnect.cpp index c6a0a15759..86a49cc189 100644 --- a/indra/newview/lltwitterconnect.cpp +++ b/indra/newview/lltwitterconnect.cpp @@ -84,8 +84,6 @@ void LLTwitterConnect::twitterConnectCoro(std::string requestToken, std::string if (!oauthVerifier.empty()) body["oauth_verifier"] = oauthVerifier; - setConnectionState(LLTwitterConnect::TWITTER_CONNECTION_IN_PROGRESS); - LLSD result = httpAdapter->putAndYield(httpRequest, getTwitterConnectURL("/connection"), body, httpOpts); LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; @@ -168,8 +166,6 @@ void LLTwitterConnect::twitterShareCoro(std::string route, LLSD share) httpOpts->setWantHeaders(true); httpOpts->setFollowRedirects(false); - setConnectionState(LLTwitterConnect::TWITTER_POSTING); - LLSD result = httpAdapter->postAndYield(httpRequest, getTwitterConnectURL(route, true), share, httpOpts); if (testShareStatus(result)) @@ -257,8 +253,6 @@ void LLTwitterConnect::twitterDisconnectCoro() httpOpts->setFollowRedirects(false); - setConnectionState(LLTwitterConnect::TWITTER_DISCONNECTING); - LLSD result = httpAdapter->deleteAndYield(httpRequest, getTwitterConnectURL("/connection"), httpOpts); LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; @@ -424,12 +418,16 @@ std::string LLTwitterConnect::getTwitterConnectURL(const std::string& route, boo void LLTwitterConnect::connectToTwitter(const std::string& request_token, const std::string& oauth_verifier) { + setConnectionState(LLTwitterConnect::TWITTER_CONNECTION_IN_PROGRESS); + LLCoros::instance().launch("LLTwitterConnect::twitterConnectCoro", boost::bind(&LLTwitterConnect::twitterConnectCoro, this, request_token, oauth_verifier)); } void LLTwitterConnect::disconnectFromTwitter() { + setConnectionState(LLTwitterConnect::TWITTER_DISCONNECTING); + LLCoros::instance().launch("LLTwitterConnect::twitterDisconnectCoro", boost::bind(&LLTwitterConnect::twitterDisconnectCoro, this)); } @@ -455,12 +453,16 @@ void LLTwitterConnect::uploadPhoto(const std::string& image_url, const std::stri body["image"] = image_url; body["status"] = status; + setConnectionState(LLTwitterConnect::TWITTER_POSTING); + LLCoros::instance().launch("LLTwitterConnect::twitterShareCoro", boost::bind(&LLTwitterConnect::twitterShareCoro, this, "/share/photo", body)); } void LLTwitterConnect::uploadPhoto(LLPointer<LLImageFormatted> image, const std::string& status) { + setConnectionState(LLTwitterConnect::TWITTER_POSTING); + LLCoros::instance().launch("LLTwitterConnect::twitterShareImageCoro", boost::bind(&LLTwitterConnect::twitterShareImageCoro, this, image, status)); } @@ -470,6 +472,8 @@ void LLTwitterConnect::updateStatus(const std::string& status) LLSD body; body["status"] = status; + setConnectionState(LLTwitterConnect::TWITTER_POSTING); + LLCoros::instance().launch("LLTwitterConnect::twitterShareCoro", boost::bind(&LLTwitterConnect::twitterShareCoro, this, "/share/status", body)); } |