summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiranV <NiranV.Dean@googlemail.com>2014-08-26 21:04:54 +0200
committerNiranV <NiranV.Dean@googlemail.com>2014-08-26 21:04:54 +0200
commited29df03092092247d2743fe1c0ec9e501c4da28 (patch)
treebcbcc69436f6545eb3de22616189525c2f44ccc8
parent0a134e749d01b711ca38a91044efb787cd815701 (diff)
STORM-2073: Fixed: Double post when clicking "Post" while not logged in. Makes the previous double post for "Connect" obselete.
-rw-r--r--indra/newview/llfloaterfacebook.cpp34
-rw-r--r--indra/newview/llfloaterfacebook.h3
2 files changed, 19 insertions, 18 deletions
diff --git a/indra/newview/llfloaterfacebook.cpp b/indra/newview/llfloaterfacebook.cpp
index 33422fb5fd..6888e076aa 100644
--- a/indra/newview/llfloaterfacebook.cpp
+++ b/indra/newview/llfloaterfacebook.cpp
@@ -157,7 +157,6 @@ void LLFacebookStatusPanel::onSend()
LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookStatusPanel"); // just in case it is already listening
LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookStatusPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectStateChange, this, _1));
- pressedConnect = FALSE;
// Connect to Facebook if necessary and then post
if (LLFacebookConnect::instance().isConnected())
{
@@ -171,6 +170,23 @@ void LLFacebookStatusPanel::onSend()
bool LLFacebookStatusPanel::onFacebookConnectStateChange(const LLSD& data)
{
+ switch (data.get("enum").asInteger())
+ {
+ case LLFacebookConnect::FB_CONNECTED:
+ sendStatus();
+ break;
+
+ case LLFacebookConnect::FB_POSTED:
+ LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookStatusPanel");
+ clearAndClose();
+ break;
+ }
+
+ return false;
+}
+
+bool LLFacebookStatusPanel::onFacebookConnectAccountStateChange(const LLSD& data)
+{
if(LLFacebookConnect::instance().isConnected())
{
//In process of disconnecting so leave the layout as is
@@ -184,19 +200,6 @@ bool LLFacebookStatusPanel::onFacebookConnectStateChange(const LLSD& data)
showDisconnectedLayout();
}
- switch (data.get("enum").asInteger())
- {
- case LLFacebookConnect::FB_CONNECTED:
- if(!pressedConnect)
- sendStatus();
- break;
-
- case LLFacebookConnect::FB_POSTED:
- LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookStatusPanel");
- clearAndClose();
- break;
- }
-
return false;
}
@@ -214,7 +217,7 @@ void LLFacebookStatusPanel::onVisibilityChange(BOOL visible)
if(visible)
{
LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel");
- LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectStateChange, this, _1));
+ LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectAccountStateChange, this, _1));
LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel");
LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectInfoChange, this));
@@ -295,7 +298,6 @@ void LLFacebookStatusPanel::onConnect()
{
LLFacebookConnect::instance().checkConnectionToFacebook(true);
- pressedConnect = TRUE;
//Clear only the facebook browser cookies so that the facebook login screen appears
LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com");
}
diff --git a/indra/newview/llfloaterfacebook.h b/indra/newview/llfloaterfacebook.h
index 6fe7a6541b..a4ca666b20 100644
--- a/indra/newview/llfloaterfacebook.h
+++ b/indra/newview/llfloaterfacebook.h
@@ -46,6 +46,7 @@ public:
void draw();
void onSend();
bool onFacebookConnectStateChange(const LLSD& data);
+ bool onFacebookConnectAccountStateChange(const LLSD& data);
void sendStatus();
void clearAndClose();
@@ -62,8 +63,6 @@ private:
void showDisconnectedLayout();
void showConnectedLayout();
- bool pressedConnect;
-
LLTextBox * mAccountCaptionLabel;
LLTextBox * mAccountNameLabel;
LLUICtrl * mPanelButtons;