From 40e9c253fc6888e3e1b150dc265d79652e9ec26c Mon Sep 17 00:00:00 2001
From: Denis Serdjuk <dserduk@productengine.com>
Date: Mon, 21 Dec 2009 14:43:09 +0200
Subject: [PATCH] additional commit to major task EXT-3509   	 User's own
 name should appear in the Group chat participant list 1. agent will be appear
 in ad-hoc conference too. 2. Disabling block/unblock yourself.

--HG--
branch : product-engine
---
 indra/newview/llavatarlist.cpp          | 6 +++---
 indra/newview/llcallfloater.cpp         | 2 +-
 indra/newview/llpanelimcontrolpanel.cpp | 3 ++-
 indra/newview/llparticipantlist.cpp     | 8 ++++----
 indra/newview/llparticipantlist.h       | 2 +-
 indra/newview/llspeakers.cpp            | 2 --
 6 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp
index 71b23e1383a..5865df3e264 100644
--- a/indra/newview/llavatarlist.cpp
+++ b/indra/newview/llavatarlist.cpp
@@ -33,7 +33,7 @@
 #include "llviewerprecompiledheaders.h"
 
 #include "llavatarlist.h"
-#include "llagent.h" // for comparator
+#include "llagentdata.h" // for comparator
 
 // newview
 #include "llcallingcard.h" // for LLAvatarTracker
@@ -425,11 +425,11 @@ bool LLAvatarItemAgentOnTopComparator::doCompare(const LLAvatarListItem* avatar_
 {
 	//keep agent on top, if first is agent, 
 	//then we need to return true to elevate this id, otherwise false.
-	if(avatar_item1->getAvatarId() == gAgent.getID())
+	if(avatar_item1->getAvatarId() == gAgentID)
 	{
 		return true;
 	}
-	else if (avatar_item2->getAvatarId() == gAgent.getID())
+	else if (avatar_item2->getAvatarId() == gAgentID)
 	{
 		return false;
 	}
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp
index 20739d24016..7ca49928da8 100644
--- a/indra/newview/llcallfloater.cpp
+++ b/indra/newview/llcallfloater.cpp
@@ -280,7 +280,7 @@ void LLCallFloater::refreshPartisipantList()
 
 	if (!non_avatar_caller)
 	{
-		mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList);
+		mPaticipants = new LLParticipantList(mSpeakerManager, mAvatarList, true, mVoiceType != VC_GROUP_CHAT && mVoiceType != VC_AD_HOC_CHAT);
 
 		if (LLLocalSpeakerMgr::getInstance() == mSpeakerManager)
 		{
diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp
index 70e47980799..ae1c28c7ab2 100644
--- a/indra/newview/llpanelimcontrolpanel.cpp
+++ b/indra/newview/llpanelimcontrolpanel.cpp
@@ -282,8 +282,9 @@ void LLPanelGroupControlPanel::setSessionId(const LLUUID& session_id)
 
 	mGroupID = LLIMModel::getInstance()->getOtherParticipantID(session_id);
 
+	// for group and Ad-hoc chat we need to include agent into list 
 	if(!mParticipantList)
-		mParticipantList = new LLParticipantList(mSpeakerManager, getChild<LLAvatarList>("speakers_list"));
+		mParticipantList = new LLParticipantList(mSpeakerManager, getChild<LLAvatarList>("speakers_list"), true,false);
 }
 
 
diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp
index afb9892d126..e8aa1e98319 100644
--- a/indra/newview/llparticipantlist.cpp
+++ b/indra/newview/llparticipantlist.cpp
@@ -51,12 +51,13 @@
 
 static const LLAvatarItemAgentOnTopComparator AGENT_ON_TOP_NAME_COMPARATOR;
 
-LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list,  bool use_context_menu/* = true*/):
+LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list,  bool use_context_menu/* = true*/,
+		bool exclude_agent /*= true*/):
 	mSpeakerMgr(data_source),
 	mAvatarList(avatar_list),
 	mSortOrder(E_SORT_BY_NAME)
 ,	mParticipantListMenu(NULL)
-,	mExcludeAgent(true)
+,	mExcludeAgent(exclude_agent)
 {
 	mSpeakerAddListener = new SpeakerAddListener(*this);
 	mSpeakerRemoveListener = new SpeakerRemoveListener(*this);
@@ -101,7 +102,6 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av
 		}
 	}
 	// we need to exclude agent id for non group chat
-	mExcludeAgent = !gAgent.isInGroup(mSpeakerMgr->getSessionID());
 	mAvatarList->setDirty(true);
 	sort();
 }
@@ -555,7 +555,7 @@ void LLParticipantList::LLParticipantListMenu::moderateVoiceOtherParticipants(co
 bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD& userdata)
 {
 	std::string item = userdata.asString();
-	if (item == "can_mute_text")
+	if (item == "can_mute_text" || "can_block" == item)
 	{
 		return mUUIDs.front() != gAgentID;
 	}
diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h
index 72c413d1884..b85d4c9bc43 100644
--- a/indra/newview/llparticipantlist.h
+++ b/indra/newview/llparticipantlist.h
@@ -43,7 +43,7 @@ class LLParticipantList
 {
 	LOG_CLASS(LLParticipantList);
 	public:
-		LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list, bool use_context_menu = true);
+		LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list, bool use_context_menu = true, bool exclude_agent = true);
 		~LLParticipantList();
 		void setSpeakingIndicatorsVisible(BOOL visible);
 
diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp
index 3861a96355c..91b417c61f3 100644
--- a/indra/newview/llspeakers.cpp
+++ b/indra/newview/llspeakers.cpp
@@ -630,8 +630,6 @@ void LLIMSpeakerMgr::toggleAllowTextChat(const LLUUID& speaker_id)
 
 void LLIMSpeakerMgr::moderateVoiceParticipant(const LLUUID& avatar_id, bool unmute)
 {
-	if (gAgentID == avatar_id) return; // do not process myself
-
 	LLPointer<LLSpeaker> speakerp = findSpeaker(avatar_id);
 	if (!speakerp) return;
 
-- 
GitLab