summaryrefslogtreecommitdiff
path: root/indra/newview/llfacebookconnect.cpp
diff options
context:
space:
mode:
authorCho <cho@lindenlab.com>2013-06-28 01:21:14 +0100
committerCho <cho@lindenlab.com>2013-06-28 01:21:14 +0100
commit0e50cbc2edacdecf32071c97c2ce5349db5ef5e9 (patch)
treebd323efb580049560eae78afc96d257f18ea4132 /indra/newview/llfacebookconnect.cpp
parentfc05dc5114785368e37e325fdb429fed7cd3c363 (diff)
made it optional to autoconnect in LLFacebookConnect::getConnectionToFacebook() for ACME-648
Diffstat (limited to 'indra/newview/llfacebookconnect.cpp')
-rw-r--r--indra/newview/llfacebookconnect.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index cf0f554149..52268daa36 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -201,9 +201,9 @@ class LLFacebookConnectedResponder : public LLHTTPClient::Responder
LOG_CLASS(LLFacebookConnectedResponder);
public:
- LLFacebookConnectedResponder()
+ LLFacebookConnectedResponder(bool auto_connect) : mAutoConnect(auto_connect)
{
- LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS);
+ LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_CONNECTION_IN_PROGRESS);
}
virtual void completed(U32 status, const std::string& reason, const LLSD& content)
@@ -223,7 +223,14 @@ public:
// show the facebook login page if not connected yet
if (status == 404)
{
- LLFacebookConnect::instance().connectToFacebook();
+ if (mAutoConnect)
+ {
+ LLFacebookConnect::instance().connectToFacebook();
+ }
+ else
+ {
+ LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED);
+ }
}
else
{
@@ -234,6 +241,7 @@ public:
}
private:
+ bool mAutoConnect;
};
///////////////////////////////////////////////////////////////////////////////
@@ -304,13 +312,13 @@ void LLFacebookConnect::disconnectFromFacebook()
LLHTTPClient::del(getFacebookConnectURL("/connection"), new LLFacebookDisconnectResponder());
}
-void LLFacebookConnect::getConnectionToFacebook()
+void LLFacebookConnect::getConnectionToFacebook(bool auto_connect)
{
if ((mConnectionState == FB_NOT_CONNECTED) || (mConnectionState == FB_CONNECTION_FAILED))
{
const bool follow_redirects=false;
const F32 timeout=HTTP_REQUEST_EXPIRY_SECS;
- LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(),
+ LLHTTPClient::get(getFacebookConnectURL("/connection"), new LLFacebookConnectedResponder(auto_connect),
LLSD(), timeout, follow_redirects);
}
}