diff options
Diffstat (limited to 'indra/newview/llpanelpeople.cpp')
-rwxr-xr-x | indra/newview/llpanelpeople.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index bd4813f945..8c8cad0743 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -839,16 +839,36 @@ void LLPanelPeople::updateRecentList() mRecentList->setDirty(); } +bool LLPanelPeople::onConnectedToFacebook(const LLSD& data) +{ + if (data.get("enum").asInteger() == LLFacebookConnect::FB_CONNECTED) + { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLPanelPeople"); + + LLFacebookConnect::instance().loadFacebookFriends(); + } + + return false; +} + void LLPanelPeople::updateFacebookList(bool visible) { - if(visible) + if (visible) { LLFacebookConnect::instance().setContentUpdatedCallback(boost::bind(&LLPanelPeople::updateSuggestedFriendList, this)); if (mTryToConnectToFbc) - { + { // try to reconnect to facebook! - LLFacebookConnect::instance().getConnectionToFacebook(false, boost::bind(&LLFacebookConnect::loadFacebookFriends, &LLFacebookConnect::instance())); + if (LLFacebookConnect::instance().isConnected()) + { + LLFacebookConnect::instance().loadFacebookFriends(); + } + else + { + LLEventPumps::instance().obtain("FacebookConnectState").listen("LLPanelPeople", boost::bind(&LLPanelPeople::onConnectedToFacebook, this, _1)); + LLFacebookConnect::instance().checkConnectionToFacebook(); + } // don't try again mTryToConnectToFbc = false; |