diff options
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llfacebookconnect.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llflickrconnect.cpp | 5 | ||||
-rw-r--r-- | indra/newview/lltwitterconnect.cpp | 16 |
3 files changed, 25 insertions, 14 deletions
diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 136e02953c..7975902f73 100755 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -165,8 +165,6 @@ void LLFacebookConnect::facebookConnectCoro(std::string authCode, std::string au httpOpts->setWantHeaders(true); httpOpts->setFollowRedirects(false); - setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS); - LLSD result = httpAdapter->putAndYield(httpRequest, getFacebookConnectURL("/connection"), putData, httpOpts, get_headers()); LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; @@ -242,8 +240,6 @@ void LLFacebookConnect::facebookShareCoro(std::string route, LLSD share) httpOpts->setWantHeaders(true); httpOpts->setFollowRedirects(false); - setConnectionState(LLFacebookConnect::FB_POSTING); - LLSD result = httpAdapter->postAndYield(httpRequest, getFacebookConnectURL(route, true), share, httpOpts, get_headers()); if (testShareStatus(result)) @@ -331,7 +327,6 @@ void LLFacebookConnect::facebookDisconnectCoro() LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - setConnectionState(LLFacebookConnect::FB_DISCONNECTING); httpOpts->setFollowRedirects(false); LLSD result = httpAdapter->deleteAndYield(httpRequest, getFacebookConnectURL("/connection"), httpOpts, get_headers()); @@ -546,6 +541,8 @@ std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route, b void LLFacebookConnect::connectToFacebook(const std::string& auth_code, const std::string& auth_state) { + setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS); + LLCoros::instance().launch("LLFacebookConnect::facebookConnectCoro", boost::bind(&LLFacebookConnect::facebookConnectCoro, this, auth_code, auth_state)); } @@ -558,6 +555,8 @@ void LLFacebookConnect::disconnectFromFacebook() void LLFacebookConnect::checkConnectionToFacebook(bool auto_connect) { + setConnectionState(LLFacebookConnect::FB_DISCONNECTING); + LLCoros::instance().launch("LLFacebookConnect::facebookConnectedCheckCoro", boost::bind(&LLFacebookConnect::facebookConnectedCheckCoro, this, auto_connect)); } @@ -583,6 +582,8 @@ void LLFacebookConnect::loadFacebookFriends() void LLFacebookConnect::postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& image, const std::string& message) { + setConnectionState(LLFacebookConnect::FB_POSTING); + LLSD body; if (!location.empty()) { @@ -611,7 +612,8 @@ void LLFacebookConnect::postCheckin(const std::string& location, const std::stri void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::string& caption) { - // *TODO: I could not find an instace where this method is used. Remove? + setConnectionState(LLFacebookConnect::FB_POSTING); + LLSD body; body["image"] = image_url; body["caption"] = caption; @@ -622,6 +624,8 @@ void LLFacebookConnect::sharePhoto(const std::string& image_url, const std::stri void LLFacebookConnect::sharePhoto(LLPointer<LLImageFormatted> image, const std::string& caption) { + setConnectionState(LLFacebookConnect::FB_POSTING); + LLCoros::instance().launch("LLFacebookConnect::facebookShareImageCoro", boost::bind(&LLFacebookConnect::facebookShareImageCoro, this, "/share/photo", image, caption)); } @@ -631,6 +635,8 @@ void LLFacebookConnect::updateStatus(const std::string& message) LLSD body; body["message"] = message; + setConnectionState(LLFacebookConnect::FB_POSTING); + LLCoros::instance().launch("LLFacebookConnect::facebookShareCoro", boost::bind(&LLFacebookConnect::facebookShareCoro, this, "/share/wall", body)); } diff --git a/indra/newview/llflickrconnect.cpp b/indra/newview/llflickrconnect.cpp index 83e4f19191..b18149a06c 100644 --- a/indra/newview/llflickrconnect.cpp +++ b/indra/newview/llflickrconnect.cpp @@ -168,8 +168,6 @@ void LLFlickrConnect::flickrShareCoro(LLSD share) httpOpts->setWantHeaders(true); httpOpts->setFollowRedirects(false); - setConnectionState(LLFlickrConnect::FLICKR_POSTING); - LLSD result = httpAdapter->postAndYield(httpRequest, getFlickrConnectURL("/share/photo", true), share, httpOpts); if (testShareStatus(result)) @@ -471,12 +469,15 @@ void LLFlickrConnect::uploadPhoto(const std::string& image_url, const std::strin body["tags"] = tags; body["safety_level"] = safety_level; + setConnectionState(LLFlickrConnect::FLICKR_POSTING); + LLCoros::instance().launch("LLFlickrConnect::flickrShareCoro", boost::bind(&LLFlickrConnect::flickrShareCoro, this, body)); } void LLFlickrConnect::uploadPhoto(LLPointer<LLImageFormatted> image, const std::string& title, const std::string& description, const std::string& tags, int safety_level) { + setConnectionState(LLFlickrConnect::FLICKR_POSTING); LLCoros::instance().launch("LLFlickrConnect::flickrShareImageCoro", boost::bind(&LLFlickrConnect::flickrShareImageCoro, this, image, 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)); } |