From ed828365b8a5371b1deadaa8cc1c2f1fdf729227 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Thu, 29 Aug 2013 16:05:49 -0700 Subject: ACME-866 User receives error when hitting Disconnect in Facebook floater, if access token was cleared manually on backend: Problem was that when the user was already disconnected the Facebook connection state was not being set to disconnected. --- indra/newview/llfacebookconnect.cpp | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'indra/newview/llfacebookconnect.cpp') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index abfacdb93c..451c0f5767 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -190,17 +190,28 @@ public: LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_DISCONNECTING); } + void setUserDisconnected() + { + // Clear data + LLFacebookConnect::instance().clearInfo(); + LLFacebookConnect::instance().clearContent(); + //Notify state change + LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED); + } + virtual void completed(U32 status, const std::string& reason, const LLSD& content) { - if (isGoodStatus(status)) + if (isGoodStatus(status)) { LL_DEBUGS("FacebookConnect") << "Disconnect successful. content: " << content << LL_ENDL; - - // Clear data - LLFacebookConnect::instance().clearInfo(); - LLFacebookConnect::instance().clearContent(); - //Notify state change - LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_NOT_CONNECTED); + setUserDisconnected(); + + } + //User not found so already disconnected + else if(status == 404) + { + LL_DEBUGS("FacebookConnect") << "Already disconnected. content: " << content << LL_ENDL; + setUserDisconnected(); } else { -- cgit v1.2.3