diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpanelpeople.cpp | 23 | ||||
-rw-r--r-- | indra/newview/llpanelpeople.h | 2 |
2 files changed, 24 insertions, 1 deletions
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 8fc1d378db..6a83e84da1 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -539,6 +539,7 @@ private: LLPanelPeople::LLPanelPeople() : LLPanel(), mConnectedToFbc(false), + mTryToConnectToFbc(true), mFilterSubString(LLStringUtil::null), mFilterSubStringOrig(LLStringUtil::null), mFilterEditor(NULL), @@ -633,7 +634,7 @@ BOOL LLPanelPeople::postBuild() mMiniMap = (LLNetMap*)getChildView("Net Map",true); mMiniMap->setToolTipMsg(gSavedSettings.getBOOL("DoubleClickTeleport") ? getString("AltMiniMapToolTipMsg") : getString("MiniMapToolTipMsg")); - + mRecentList = getChild<LLPanel>(RECENT_TAB_NAME)->getChild<LLAvatarList>("avatar_list"); mRecentList->setNoItemsCommentText(getString("no_recent_people")); mRecentList->setNoItemsMsg(getString("no_recent_people")); @@ -651,6 +652,7 @@ BOOL LLPanelPeople::postBuild() LLPanel * social_tab = getChild<LLPanel>(FBCTEST_TAB_NAME); mFacebookFriends = social_tab->getChild<LLSocialList>("facebook_friends"); + social_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFbcTestListUpdater, _2)); setSortOrder(mRecentList, (ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"), false); setSortOrder(mAllFriendList, (ESortOrder)gSavedSettings.getU32("FriendsSortOrder"), false); @@ -922,6 +924,17 @@ void LLPanelPeople::updateFbcTestList() mFbcTestListUpdater->setActive(false); } } + else if (mTryToConnectToFbc) + { + // try to reconnect to facebook! + tryToReconnectToFacebook(); + + // don't try again + mTryToConnectToFbc = false; + + // stop updating + mFbcTestListUpdater->setActive(false); + } } void LLPanelPeople::buttonSetVisible(std::string btn_name, BOOL visible) @@ -1829,6 +1842,14 @@ void LLPanelPeople::loadFacebookFriends() LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/friends", new FacebookFriendsResponder(this)); } +void LLPanelPeople::tryToReconnectToFacebook() +{ + if (!mConnectedToFbc) + { + LLHTTPClient::get(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connected", new FacebookConnectedResponder(this, false)); + } +} + void LLPanelPeople::connectToFacebook(const std::string& auth_code) { LLSD body; diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index d61eb80f57..2ac83c3677 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -62,10 +62,12 @@ public: void showFacebookFriends(const LLSD& friends); void hideFacebookFriends(); void loadFacebookFriends(); + void tryToReconnectToFacebook(); void connectToFacebook(const std::string& auth_code); void disconnectFromFacebook(); bool mConnectedToFbc; + bool mTryToConnectToFbc; // internals class Updater; |