diff options
author | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-05-03 13:55:12 -0700 |
---|---|---|
committer | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-05-03 13:55:12 -0700 |
commit | 0408a984d3efb55cdf88c314e333be3b29c291ea (patch) | |
tree | 2e558951d55a5274c438f6feacd229a3961d065b /indra/newview | |
parent | 1b6d6b7e794ad4401faa91a79774922a5baec968 (diff) |
ACME-324 Populate list with FB only friends: When clicking the '+' button FB only friends will appear in the second tab titled 'Invite people you know to SL'.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llpanelpeople.cpp | 38 | ||||
-rw-r--r-- | indra/newview/llpersonfolderview.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llpersonfolderview.h | 1 |
3 files changed, 36 insertions, 4 deletions
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 22b79a9380..e1933c041c 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -1641,17 +1641,29 @@ void LLPanelPeople::openFacebookWeb(std::string url) void LLPanelPeople::showFacebookFriends(const LLSD& friends) { mFacebookFriends->clear(); + S32 model_index; 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); + //FB+SL but not SL friend + if(agent_id.notNull()) + { + model_index = 0; + } + //FB only friend + else + { + model_index = 1; + } + //add to avatar list mFacebookFriends->addNewItem(agent_id, name, false); //Add to folder view - LLPersonTabModel * session_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->mPersonFolderModelMap.begin()->second); + LLPersonTabModel * session_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]); if(session_model) { addParticipantToModel(session_model, agent_id, name); @@ -1663,11 +1675,29 @@ void LLPanelPeople::addTestParticipant() { std::string suffix("Aa"); std::string prefix("Test Name"); + LLPersonTabModel * person_folder_model; + LLUUID agentID; + std::string name; + S32 model_index; + for(int i = 0; i < 300; ++i) { - LLPersonTabModel * person_folder_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->mPersonFolderModelMap.begin()->second); - std::string name = prefix + " " + suffix; - addParticipantToModel(person_folder_model, gAgent.getID(), name); + //Adds FB+SL people that aren't yet SL friends + if(i < 10) + { + model_index = 0; + agentID = gAgent.getID(); + } + //Adds FB only friends + else + { + model_index = 1; + agentID = LLUUID(NULL); + } + + person_folder_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->mPersonFolderModelMap[mPersonFolderView->mPersonTabIDs[model_index]]); + name = prefix + " " + suffix; + addParticipantToModel(person_folder_model, agentID, name); // Next suffix : Aa, Ab, Ac ... Az, Ba, Bb, Bc ... Bz, Ca, Cb ... suffix[1]+=1; if (suffix[1]=='{') diff --git a/indra/newview/llpersonfolderview.cpp b/indra/newview/llpersonfolderview.cpp index 21578e986b..8f468e6814 100644 --- a/indra/newview/llpersonfolderview.cpp +++ b/indra/newview/llpersonfolderview.cpp @@ -65,6 +65,7 @@ void LLPersonFolderView::createPersonTab(const std::string& tab_name) LLPersonTabView * widget = LLUICtrlFactory::create<LLPersonTabView>(params); widget->addToFolder(this); + mPersonTabIDs.push_back(item->getID()); mPersonFolderModelMap[item->getID()] = item; mPersonFolderViewMap[item->getID()] = widget; } diff --git a/indra/newview/llpersonfolderview.h b/indra/newview/llpersonfolderview.h index 1cf597b8c9..3f5f874e0f 100644 --- a/indra/newview/llpersonfolderview.h +++ b/indra/newview/llpersonfolderview.h @@ -61,6 +61,7 @@ public: person_folder_model_map mPersonFolderModelMap; person_folder_view_map mPersonFolderViewMap; + std::vector<LLUUID> mPersonTabIDs; LLEventStream mConversationsEventStream; }; |