STORM-2073: Fixed: Do not post our status if we press the "Connect" button otherwise we end up double posting.

meow-7.2.2
NiranV 2014-08-20 01:38:50 +02:00
parent bca5c1ed79
commit 2b66eeb4a6
2 changed files with 7 additions and 2 deletions

View File

@ -156,7 +156,8 @@ 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())
{
@ -186,7 +187,8 @@ bool LLFacebookStatusPanel::onFacebookConnectStateChange(const LLSD& data)
switch (data.get("enum").asInteger())
{
case LLFacebookConnect::FB_CONNECTED:
sendStatus();
if(!pressedConnect)
sendStatus();
break;
case LLFacebookConnect::FB_POSTED:
@ -293,6 +295,7 @@ 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");
}

View File

@ -62,6 +62,8 @@ private:
void showDisconnectedLayout();
void showConnectedLayout();
bool pressedConnect;
LLTextBox * mAccountCaptionLabel;
LLTextBox * mAccountNameLabel;
LLUICtrl * mPanelButtons;