From df26597c0d2ddfcc259dd1b8e838164cbd9ff02a Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 28 Feb 2014 01:49:58 +0000 Subject: Added FB+SL friends list to Friends tab in Facebook floater for ACME-1334 --- indra/newview/llfacebookconnect.cpp | 2 +- indra/newview/llfloaterfacebook.cpp | 20 +++++++++++++++----- indra/newview/llfloaterfacebook.h | 1 + .../skins/default/xui/en/panel_facebook_friends.xml | 19 ++++++++++++++++++- 4 files changed, 35 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index ec7d0f7c50..d90b649ecd 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -388,7 +388,7 @@ std::string LLFacebookConnect::getFacebookConnectURL(const std::string& route, b if (regionp) { //url = "http://pdp15.lindenlab.com/fbc/agent/" + gAgentID.asString(); // TEMPORARY FOR TESTING - CHO - url = regionp->getCapability("FacebookConnect"); + url = regionp->getCapability("FacebookConnect"); url += route; if (include_read_from_master && mReadFromMaster) diff --git a/indra/newview/llfloaterfacebook.cpp b/indra/newview/llfloaterfacebook.cpp index 5589d4897d..6c2c2428c5 100644 --- a/indra/newview/llfloaterfacebook.cpp +++ b/indra/newview/llfloaterfacebook.cpp @@ -750,12 +750,16 @@ void LLFacebookCheckinPanel::clearAndClose() /////////////////////////// LLFacebookFriendsPanel::LLFacebookFriendsPanel() : +mSecondLifeFriends(NULL), mSuggestedFriends(NULL) { } BOOL LLFacebookFriendsPanel::postBuild() { + mSecondLifeFriends = getChild("second_life_friends"); + mSecondLifeFriends->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu); + mSuggestedFriends = getChild("suggested_friends"); mSuggestedFriends->setContextMenu(&LLPanelPeopleMenus::gSuggestedFriendsContextMenu); @@ -767,6 +771,8 @@ BOOL LLFacebookFriendsPanel::postBuild() bool LLFacebookFriendsPanel::updateSuggestedFriendList() { const LLAvatarTracker& av_tracker = LLAvatarTracker::instance(); + uuid_vec_t& second_life_friends = mSecondLifeFriends->getIDs(); + second_life_friends.clear(); uuid_vec_t& suggested_friends = mSuggestedFriends->getIDs(); suggested_friends.clear(); @@ -775,19 +781,23 @@ bool LLFacebookFriendsPanel::updateSuggestedFriendList() for (LLSD::array_const_iterator i = friends.beginArray(); i != friends.endArray(); ++i) { LLUUID agent_id = (*i).asUUID(); - bool second_life_buddy = agent_id.notNull() ? av_tracker.isBuddy(agent_id) : false; - - if(!second_life_buddy) + if (agent_id.notNull()) { - //FB+SL but not SL friend - if (agent_id.notNull()) + bool second_life_buddy = av_tracker.isBuddy(agent_id); + if (second_life_buddy) + { + second_life_friends.push_back(agent_id); + } + else { + //FB+SL but not SL friend suggested_friends.push_back(agent_id); } } } //Force a refresh when there aren't any filter matches (prevent displaying content that shouldn't display) + mSecondLifeFriends->setDirty(true, !mSecondLifeFriends->filterHasMatches()); mSuggestedFriends->setDirty(true, !mSuggestedFriends->filterHasMatches()); //showFriendsAccordionsIfNeeded(); diff --git a/indra/newview/llfloaterfacebook.h b/indra/newview/llfloaterfacebook.h index 08c5f24e4d..c13d64a86a 100644 --- a/indra/newview/llfloaterfacebook.h +++ b/indra/newview/llfloaterfacebook.h @@ -139,6 +139,7 @@ private: void updateFacebookList(bool visible); bool onConnectedToFacebook(const LLSD& data); + LLAvatarList* mSecondLifeFriends; LLAvatarList* mSuggestedFriends; }; diff --git a/indra/newview/skins/default/xui/en/panel_facebook_friends.xml b/indra/newview/skins/default/xui/en/panel_facebook_friends.xml index 07cbd06afa..9d5c86c79d 100644 --- a/indra/newview/skins/default/xui/en/panel_facebook_friends.xml +++ b/indra/newview/skins/default/xui/en/panel_facebook_friends.xml @@ -15,11 +15,28 @@ name="friends_accordion" right="-2" top_pad="2"> + + + + title="Add these people as SL friends">