summaryrefslogtreecommitdiff
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
parentfc05dc5114785368e37e325fdb429fed7cd3c363 (diff)
made it optional to autoconnect in LLFacebookConnect::getConnectionToFacebook() for ACME-648
-rw-r--r--indra/newview/llfacebookconnect.cpp18
-rw-r--r--indra/newview/llfacebookconnect.h2
-rw-r--r--indra/newview/llfloatersocial.cpp2
-rwxr-xr-xindra/newview/llpanelpeople.cpp2
-rwxr-xr-xindra/newview/llpanelsnapshotfacebook.cpp2
-rwxr-xr-xindra/newview/llviewermenu.cpp2
6 files changed, 18 insertions, 10 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);
}
}
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h
index a19b6fbb98..c54da8e3f3 100644
--- a/indra/newview/llfacebookconnect.h
+++ b/indra/newview/llfacebookconnect.h
@@ -54,7 +54,7 @@ public:
void connectToFacebook(const std::string& auth_code = ""); // Initiate the complete FB connection. Please use getConnectionToFacebook() in normal use.
void disconnectFromFacebook(); // Disconnect from the FBC service.
- void getConnectionToFacebook(); // Check if an access token is available on the FBC service. If not, call connectToFacebook().
+ void getConnectionToFacebook(bool auto_connect = false); // Check if an access token is available on the FBC service. If not, call connectToFacebook().
void loadFacebookFriends();
void postCheckin(const std::string& location, const std::string& name, const std::string& description, const std::string& picture, const std::string& message);
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 8d026471dc..35761d5cc8 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -516,7 +516,7 @@ void LLFloaterSocial::onCancel()
BOOL LLFloaterSocial::postBuild()
{
// Initiate a connection to Facebook (getConnectionToFacebook() handles the already connected state)
- LLFacebookConnect::instance().getConnectionToFacebook();
+ LLFacebookConnect::instance().getConnectionToFacebook(true);
// Keep tab of the Photo Panel
mSocialPhotoPanel = static_cast<LLSocialPhotoPanel*>(getChild<LLUICtrl>("panel_social_photo"));
return LLFloater::postBuild();
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index b6b72800f9..92391f0537 100755
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -1683,7 +1683,7 @@ void LLPanelPeople::onLoginFbcButtonClicked()
}
else
{
- LLFacebookConnect::instance().getConnectionToFacebook();
+ LLFacebookConnect::instance().getConnectionToFacebook(true);
}
}
diff --git a/indra/newview/llpanelsnapshotfacebook.cpp b/indra/newview/llpanelsnapshotfacebook.cpp
index 0a76bc3b9d..94fbb986c0 100755
--- a/indra/newview/llpanelsnapshotfacebook.cpp
+++ b/indra/newview/llpanelsnapshotfacebook.cpp
@@ -89,7 +89,7 @@ void LLPanelSnapshotFacebook::onOpen(const LLSD& key)
{
if (!LLFacebookConnect::instance().isConnected())
{
- LLFacebookConnect::instance().getConnectionToFacebook();
+ LLFacebookConnect::instance().getConnectionToFacebook(true);
}
updateControls(key);
LLPanelSnapshot::onOpen(key);
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index df2da12045..47787e2687 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -5957,7 +5957,7 @@ void handle_facebook_connect()
{
if (!LLFacebookConnect::instance().isConnected())
{
- LLFacebookConnect::instance().getConnectionToFacebook();
+ LLFacebookConnect::instance().getConnectionToFacebook(true);
}
}