summaryrefslogtreecommitdiff
path: root/indra/newview/llfacebookconnect.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfacebookconnect.cpp')
-rw-r--r--indra/newview/llfacebookconnect.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 7c1e7b3b16..0d6806d252 100644
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -247,6 +247,35 @@ private:
///////////////////////////////////////////////////////////////////////////////
//
+class LLFacebookDisconnectThenConnectResponder : public LLHTTPClient::Responder
+{
+ LOG_CLASS(LLFacebookDisconnectThenConnectResponder);
+public:
+
+ virtual void completed(U32 status, const std::string& reason, const LLSD& content)
+ {
+ if (isGoodStatus(status))
+ {
+ LL_DEBUGS("FacebookConnect") << "Disconnect successful. content: " << content << LL_ENDL;
+
+ // Clear all facebook stuff
+ LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED);
+ LLFacebookConnect::instance().clearContent();
+
+ LLViewerMedia::clearAllCookies();
+
+ //Now attempt to reconnect
+ LLFacebookConnect::instance().checkConnectionToFacebook(true);
+ }
+ else
+ {
+ log_facebook_connect_error("Disconnect", status, reason, content.get("error_code"), content.get("error_description"));
+ }
+ }
+};
+
+///////////////////////////////////////////////////////////////////////////////
+//
class LLFacebookInfoResponder : public LLHTTPClient::Responder
{
LOG_CLASS(LLFacebookInfoResponder);
@@ -363,6 +392,11 @@ void LLFacebookConnect::checkConnectionToFacebook(bool auto_connect)
}
}
+void LLFacebookConnect::disconnectThenConnectToFacebook()
+{
+ LLHTTPClient::del(getFacebookConnectURL("/connection"), new LLFacebookDisconnectThenConnectResponder());
+}
+
void LLFacebookConnect::loadFacebookInfo()
{
const bool follow_redirects = false;