summaryrefslogtreecommitdiff
path: root/indra/newview/llfacebookconnect.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2015-09-16 15:04:57 -0700
committerRider Linden <rider@lindenlab.com>2015-09-16 15:04:57 -0700
commitc7d5a4bab75b651b65e173a17079438f03695cc1 (patch)
treea4e8046e2232a4907a37eba0e95cca54b1a37a04 /indra/newview/llfacebookconnect.cpp
parentfd27f0feb8ba4a2a8ac2b2c3b71bf71ab56aa42e (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/llfacebookconnect.cpp')
-rwxr-xr-xindra/newview/llfacebookconnect.cpp18
1 files changed, 12 insertions, 6 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));
}