From d5a0fd7997352c80273ccb172a40250204ee0b34 Mon Sep 17 00:00:00 2001
From: Mike Antipov <mantipov@productengine.com>
Date: Tue, 23 Feb 2010 13:20:43 +0200
Subject: [PATCH] Work on major bug EXT-5562 (Misleading Active Voice
 Indicators in Group Chat Window, when Speakers are in Spatial Chat Only) -
 updated interfaces of LLSpeakingIndicatorManager::registerSpeakingIndicator &
 LLOutputMonitorCtrl::setSpeakerId     to take a target session id for which
 registered indicator should be shown.

--HG--
branch : product-engine
---
 indra/newview/lloutputmonitorctrl.cpp        |  2 +-
 indra/newview/lloutputmonitorctrl.h          | 10 +++++++++-
 indra/newview/llspeakingindicatormanager.cpp | 14 ++++++++++----
 indra/newview/llspeakingindicatormanager.h   |  6 +++++-
 4 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp
index 9857e37bc37..f2253f89aa7 100644
--- a/indra/newview/lloutputmonitorctrl.cpp
+++ b/indra/newview/lloutputmonitorctrl.cpp
@@ -247,7 +247,7 @@ void LLOutputMonitorCtrl::draw()
 		gl_rect_2d(0, monh, monw, 0, sColorBound, FALSE);
 }
 
-void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id)
+void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id, const LLUUID& session_id/* = LLUUID::null*/)
 {
 	if (speaker_id.isNull() && mSpeakerId.notNull())
 	{
diff --git a/indra/newview/lloutputmonitorctrl.h b/indra/newview/lloutputmonitorctrl.h
index 2bbfa251e9d..b7454a5066a 100644
--- a/indra/newview/lloutputmonitorctrl.h
+++ b/indra/newview/lloutputmonitorctrl.h
@@ -86,7 +86,15 @@ class LLOutputMonitorCtrl
 
 	void			setIsTalking(bool val) { mIsTalking = val; }
 
-	void			setSpeakerId(const LLUUID& speaker_id);
+	/**
+	 * Sets avatar UUID to interact with voice channel.
+	 *
+	 * @param speaker_id LLUUID of an avatar whose voice level is displayed.
+	 * @param session_id session UUID for which indicator should be shown only. Passed to LLSpeakingIndicatorManager
+	 *		If this parameter is set registered indicator will be shown only in voice channel
+	 *		which has the same session id (EXT-5562).
+	 */
+	void			setSpeakerId(const LLUUID& speaker_id, const LLUUID& session_id = LLUUID::null);
 
 	//called by mute list
 	virtual void onChange();
diff --git a/indra/newview/llspeakingindicatormanager.cpp b/indra/newview/llspeakingindicatormanager.cpp
index d33c050ee45..74b45217d30 100644
--- a/indra/newview/llspeakingindicatormanager.cpp
+++ b/indra/newview/llspeakingindicatormanager.cpp
@@ -65,8 +65,12 @@ class SpeakingIndicatorManager : public LLSingleton<SpeakingIndicatorManager>, L
 	 *
 	 * @param speaker_id LLUUID of an avatar whose speaking indicator is registered.
 	 * @param speaking_indicator instance of the speaking indicator to be registered.
+	 * @param session_id session UUID for which indicator should be shown only.
+	 *		If this parameter is set registered indicator will be shown only in voice channel
+	 *		which has the same session id (EXT-5562).
 	 */
-	void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator);
+	void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator,
+		const LLUUID& session_id = LLUUID::null);
 
 	/**
 	 * Removes passed speaking indicator from observing.
@@ -138,7 +142,8 @@ class SpeakingIndicatorManager : public LLSingleton<SpeakingIndicatorManager>, L
 //////////////////////////////////////////////////////////////////////////
 // PUBLIC SECTION
 //////////////////////////////////////////////////////////////////////////
-void SpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator)
+void SpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator,
+														 const LLUUID& session_id)
 {
 	// do not exclude agent's indicators. They should be processed in the same way as others. See EXT-3889.
 
@@ -274,9 +279,10 @@ void SpeakingIndicatorManager::ensureInstanceDoesNotExist(LLSpeakingIndicator* c
 /*         LLSpeakingIndicatorManager namespace implementation          */
 /************************************************************************/
 
-void LLSpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator)
+void LLSpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator,
+														   const LLUUID& session_id/* = LLUUID::null*/)
 {
-	SpeakingIndicatorManager::instance().registerSpeakingIndicator(speaker_id, speaking_indicator);
+	SpeakingIndicatorManager::instance().registerSpeakingIndicator(speaker_id, speaking_indicator, session_id);
 }
 
 void LLSpeakingIndicatorManager::unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator)
diff --git a/indra/newview/llspeakingindicatormanager.h b/indra/newview/llspeakingindicatormanager.h
index ce0158f7d86..cd72b85bfde 100644
--- a/indra/newview/llspeakingindicatormanager.h
+++ b/indra/newview/llspeakingindicatormanager.h
@@ -52,8 +52,12 @@ namespace LLSpeakingIndicatorManager
 	 *
 	 * @param speaker_id LLUUID of an avatar whose speaker indicator is registered.
 	 * @param speaking_indicator instance of the speaker indicator to be registered.
+	 * @param session_id session UUID for which indicator should be shown only.
+	 *		If this parameter is set registered indicator will be shown only in voice channel
+	 *		which has the same session id (EXT-5562).
 	 */
-	void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator);
+	void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator,
+								   const LLUUID& session_id = LLUUID::null);
 
 	/**
 	 * Removes passed speaking indicator from observing.
-- 
GitLab