summaryrefslogtreecommitdiff
path: root/indra/newview/lltwitterconnect.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltwitterconnect.cpp')
-rw-r--r--indra/newview/lltwitterconnect.cpp16
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));
}