summaryrefslogtreecommitdiff
path: root/indra/newview/llparticipantlist.cpp
diff options
context:
space:
mode:
authorNyx (Neal Orman) <nyx@lindenlab.com>2009-12-18 15:23:33 -0500
committerNyx (Neal Orman) <nyx@lindenlab.com>2009-12-18 15:23:33 -0500
commit7836bba2dcaf47e2ccb43185507215c0cea9f76f (patch)
tree60f362913cb49d150637669d2b762156cdfe8a63 /indra/newview/llparticipantlist.cpp
parentfd71944170e69b0fc47b45c385c33ef7acf4cafb (diff)
parent8246111b12025bfb5864af354632737f67c32bd1 (diff)
merging latest PE changes into viewer-2-0
Diffstat (limited to 'indra/newview/llparticipantlist.cpp')
-rw-r--r--indra/newview/llparticipantlist.cpp27
1 files changed, 22 insertions, 5 deletions
diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp
index 93e5b8fa15..afb9892d12 100644
--- a/indra/newview/llparticipantlist.cpp
+++ b/indra/newview/llparticipantlist.cpp
@@ -49,11 +49,14 @@
#pragma warning (disable : 4355) // 'this' used in initializer list: yes, intentionally
#endif
+static const LLAvatarItemAgentOnTopComparator AGENT_ON_TOP_NAME_COMPARATOR;
+
LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list, bool use_context_menu/* = true*/):
mSpeakerMgr(data_source),
mAvatarList(avatar_list),
mSortOrder(E_SORT_BY_NAME)
, mParticipantListMenu(NULL)
+, mExcludeAgent(true)
{
mSpeakerAddListener = new SpeakerAddListener(*this);
mSpeakerRemoveListener = new SpeakerRemoveListener(*this);
@@ -97,6 +100,8 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av
mModeratorList.insert(speakerp->mID);
}
}
+ // we need to exclude agent id for non group chat
+ mExcludeAgent = !gAgent.isInGroup(mSpeakerMgr->getSessionID());
mAvatarList->setDirty(true);
sort();
}
@@ -110,13 +115,16 @@ LLParticipantList::~LLParticipantList()
// It is possible Participant List will be re-created from LLCallFloater::onCurrentChannelChanged()
// See ticket EXT-3427
// hide menu before deleting it to stop enable and check handlers from triggering.
- if(mParticipantListMenu)
+ if(mParticipantListMenu && !LLApp::isExiting())
{
mParticipantListMenu->hide();
}
- delete mParticipantListMenu;
- mParticipantListMenu = NULL;
+ if (mParticipantListMenu)
+ {
+ delete mParticipantListMenu;
+ mParticipantListMenu = NULL;
+ }
}
void LLParticipantList::setSpeakingIndicatorsVisible(BOOL visible)
@@ -307,7 +315,16 @@ void LLParticipantList::sort()
// TODO: Implement more sorting orders after specs updating (EM)
switch ( mSortOrder ) {
case E_SORT_BY_NAME :
- mAvatarList->sortByName();
+ // if mExcludeAgent == true , then no need to keep agent on top of the list
+ if(mExcludeAgent)
+ {
+ mAvatarList->sortByName();
+ }
+ else
+ {
+ mAvatarList->setComparator(&AGENT_ON_TOP_NAME_COMPARATOR);
+ mAvatarList->sort();
+ }
break;
default :
llwarns << "Unrecognized sort order for " << mAvatarList->getName() << llendl;
@@ -317,7 +334,7 @@ void LLParticipantList::sort()
void LLParticipantList::addAvatarIDExceptAgent(std::vector<LLUUID>& existing_list, const LLUUID& avatar_id)
{
- if (gAgent.getID() == avatar_id) return;
+ if (mExcludeAgent && gAgent.getID() == avatar_id) return;
existing_list.push_back(avatar_id);
adjustParticipant(avatar_id);