diff options
author | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-07-19 16:36:55 -0700 |
---|---|---|
committer | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-07-19 16:36:55 -0700 |
commit | c3c61018cd2d6547c4976c04edc4d3212cf3fb31 (patch) | |
tree | f27f917caecfedd35da60b9b855af6551ac80e56 /indra/newview/llfloatersocial.cpp | |
parent | 03563fcaa17c0af776c49baaa59421921603cddd (diff) |
ACME-732 Create the viewer side info route responder
Diffstat (limited to 'indra/newview/llfloatersocial.cpp')
-rw-r--r-- | indra/newview/llfloatersocial.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index e61d86c474..d734518cbb 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -650,6 +650,11 @@ void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility) LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialAccountPanel"); LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialAccountPanel", boost::bind(&LLSocialAccountPanel::onFacebookConnectStateChange, this, _1)); + LLFacebookConnect::instance().loadFacebookInfo(); + + LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLSocialAccountPanel"); + LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLSocialAccountPanel", boost::bind(&LLSocialAccountPanel::onFacebookConnectInfoChange, this)); + if(LLFacebookConnect::instance().isConnected()) { showConnectedLayout(); @@ -663,6 +668,7 @@ void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility) else { LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialAccountPanel"); + LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLSocialAccountPanel"); } } @@ -687,6 +693,21 @@ bool LLSocialAccountPanel::onFacebookConnectStateChange(const LLSD& data) return false; } +bool LLSocialAccountPanel::onFacebookConnectInfoChange() +{ + LLSD info = LLFacebookConnect::instance().getInfo(); + std::string clickable_name; + + if(info.has("link") && info.has("name")) + { + clickable_name = "[" + info["link"].asString() + " " + info["name"].asString() + "]"; + } + + mAccountNameLabel->setText(clickable_name); + + return false; +} + void LLSocialAccountPanel::showConnectButton() { if(!mConnectButton->getVisible()) @@ -726,8 +747,9 @@ void LLSocialAccountPanel::showDisconnectedLayout() void LLSocialAccountPanel::showConnectedLayout() { + LLFacebookConnect::instance().loadFacebookInfo(); + mAccountCaptionLabel->setText(getString("facebook_connected")); - mAccountNameLabel->setText(std::string("[secondlife:/// Philippe Bossut]")); hideConnectButton(); } |