summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelpeople.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2013-05-06 18:40:22 -0700
committerMerov Linden <merov@lindenlab.com>2013-05-06 18:40:22 -0700
commita26c7df637aea37aa5bf823f41f574d2ddd4ea70 (patch)
treeaa78044ebced7f959edd2ddc483867f75bfbfe81 /indra/newview/llpanelpeople.cpp
parent00275301fc6606c98f77f8fbb8e485b3788831a8 (diff)
parent04587bdb9d5e1653d5b19a6ca51e547180994958 (diff)
Pull merge from viewer-fbc
Diffstat (limited to 'indra/newview/llpanelpeople.cpp')
-rw-r--r--indra/newview/llpanelpeople.cpp70
1 files changed, 38 insertions, 32 deletions
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 66a183d5e5..af9ecd743c 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -750,31 +750,6 @@ BOOL LLPanelPeople::postBuild()
scroller->setFollowsAll();
mPersonFolderView->setScrollContainer(scroller);
mPersonFolderView->setFollowsAll();
-
- //Create a person tab
- LLPersonTabModel* item = new LLPersonTabModel("Facebook Friends", mPersonFolderViewModel);
- LLPersonTabView::Params params;
- params.name = item->getDisplayName();
- params.root = mPersonFolderView;
- params.listener = item;
- params.tool_tip = params.name;
- LLPersonTabView * widget = LLUICtrlFactory::create<LLPersonTabView>(params);
- widget->addToFolder(mPersonFolderView);
-
- mPersonFolderView->mPersonFolderModelMap[item->getID()] = item;
- mPersonFolderView->mPersonFolderViewMap[item->getID()] = widget;
-
- //Create a person tab
- item = new LLPersonTabModel("Facebook Friends Tab Two", mPersonFolderViewModel);
- params.name = item->getDisplayName();
- params.root = mPersonFolderView;
- params.listener = item;
- params.tool_tip = params.name;
- widget = LLUICtrlFactory::create<LLPersonTabView>(params);
- widget->addToFolder(mPersonFolderView);
-
- mPersonFolderView->mPersonFolderModelMap[item->getID()] = item;
- mPersonFolderView->mPersonFolderViewMap[item->getID()] = widget;
gIdleCallbacks.addFunction(idle, this);
@@ -1667,6 +1642,8 @@ void LLPanelPeople::openFacebookWeb(std::string url)
void LLPanelPeople::showFacebookFriends(const LLSD& friends)
{
mFacebookFriends->clear();
+ LLPersonTabModel::tab_type tab_type;
+ LLAvatarTracker& avatar_tracker = LLAvatarTracker::instance();
for (LLSD::map_const_iterator i = friends.beginMap(); i != friends.endMap(); ++i)
{
@@ -1676,11 +1653,22 @@ void LLPanelPeople::showFacebookFriends(const LLSD& friends)
//add to avatar list
mFacebookFriends->addNewItem(agent_id, name, false);
- //Add to folder view
- LLPersonTabModel * session_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->mPersonFolderModelMap.begin()->second);
- if(session_model)
+ //FB+SL but not SL friend
+ if(agent_id.notNull() && !avatar_tracker.isBuddy(agent_id))
+ {
+ tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND;
+ }
+ //FB only friend
+ else
+ {
+ tab_type = LLPersonTabModel::FB_ONLY_FRIEND;
+ }
+
+ //Add to person tab model
+ LLPersonTabModel * person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->getPersonTabModelByIndex(tab_type));
+ if(person_tab_model)
{
- addParticipantToModel(session_model, agent_id, name);
+ addParticipantToModel(person_tab_model, agent_id, name);
}
}
}
@@ -1689,11 +1677,29 @@ void LLPanelPeople::addTestParticipant()
{
std::string suffix("Aa");
std::string prefix("Test Name");
+ LLPersonTabModel * person_tab_model;
+ LLUUID agentID;
+ std::string name;
+ LLPersonTabModel::tab_type tab_type;
+
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)
+ {
+ tab_type = LLPersonTabModel::FB_SL_NON_SL_FRIEND;
+ agentID = gAgent.getID();
+ }
+ //Adds FB only friends
+ else
+ {
+ tab_type = LLPersonTabModel::FB_ONLY_FRIEND;
+ agentID = LLUUID(NULL);
+ }
+
+ person_tab_model = dynamic_cast<LLPersonTabModel *>(mPersonFolderView->getPersonTabModelByIndex(tab_type));
+ name = prefix + " " + suffix;
+ addParticipantToModel(person_tab_model, agentID, name);
// Next suffix : Aa, Ab, Ac ... Az, Ba, Bb, Bc ... Bz, Ca, Cb ...
suffix[1]+=1;
if (suffix[1]=='{')