diff options
author | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-05-30 17:03:54 -0700 |
---|---|---|
committer | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-05-30 17:03:54 -0700 |
commit | 296377a64f1fee320e4f86a858116e2831c6e4aa (patch) | |
tree | 9627e96cc0224fb600cf7a809ad5222bcf42b682 /indra | |
parent | e72a9ebf638db2197920115be57493a40d54d2b6 (diff) |
ACME-434 When tab becomes visible, pull suggested friends data.
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/llpanelpeople.cpp | 34 | ||||
-rwxr-xr-x | indra/newview/llpanelpeople.h | 2 |
2 files changed, 36 insertions, 0 deletions
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 69b6bdf737..785de6e9c9 100755 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -652,8 +652,11 @@ BOOL LLPanelPeople::postBuild() // updater is active only if panel is visible to user. friends_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFriendListUpdater, _2)); friends_tab->setVisibleCallback(boost::bind(&LLPanelPeople::removePicker, this)); + friends_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFacebookListUpdater, _2)); + mOnlineFriendList = friends_tab->getChild<LLAvatarList>("avatars_online"); mAllFriendList = friends_tab->getChild<LLAvatarList>("avatars_all"); + mSuggestedFriends = friends_tab->getChild<LLAvatarList>("suggested_friends"); mOnlineFriendList->setNoItemsCommentText(getString("no_friends_online")); mOnlineFriendList->setShowIcons("FriendsListShowIcons"); mOnlineFriendList->showPermissions("FriendsListShowPermissions"); @@ -895,6 +898,35 @@ void LLPanelPeople::updateFriendList() //update trash and other buttons according to a selected item updateButtons(); showFriendsAccordionsIfNeeded(); + + updateSuggestedFriendList(); +} + +void LLPanelPeople::updateSuggestedFriendList() +{ + const LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); + uuid_vec_t& suggested_friends = mSuggestedFriends->getIDs(); + suggested_friends.clear(); + + //Add suggested friends + LLSD friends = LLFacebookConnect::instance().getContent(); + for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i) + { + std::string name = i->second["name"].asString(); + LLUUID agent_id = i->second.has("agent_id") ? i->second["agent_id"].asUUID() : LLUUID(NULL); + bool second_life_buddy = agent_id.notNull() ? av_tracker.isBuddy(agent_id) : false; + + if(!second_life_buddy) + { + //FB+SL but not SL friend + if (agent_id.notNull()) + { + suggested_friends.push_back(agent_id); + } + } + } + + mSuggestedFriends->setDirty(true, true); } void LLPanelPeople::updateNearbyList() @@ -973,6 +1005,8 @@ void LLPanelPeople::updateFacebookList() } } } + + updateSuggestedFriendList(); } } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index f617517392..9cfa6b7cd2 100755 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -85,6 +85,7 @@ private: // methods indirectly called by the updaters void updateFriendListHelpText(); void updateFriendList(); + void updateSuggestedFriendList(); void updateNearbyList(); void updateRecentList(); void updateFacebookList(); @@ -148,6 +149,7 @@ private: LLTabContainer* mTabContainer; LLAvatarList* mOnlineFriendList; LLAvatarList* mAllFriendList; + LLAvatarList* mSuggestedFriends; LLAvatarList* mNearbyList; LLAvatarList* mRecentList; LLGroupList* mGroupList; |