From 44e1f34f962c0e75172286b63f3514c60fee536b Mon Sep 17 00:00:00 2001
From: Mike Antipov <mantipov@productengine.com>
Date: Thu, 14 Jan 2010 17:29:56 +0200
Subject: [PATCH] Work on major bug EXT-3976 (Voice chat speaking indicators
 should only display when users are in the same voice channel) -- refactoring:
 implemented processing of switching indicator on/off in the same way

--HG--
branch : product-engine
---
 indra/newview/lloutputmonitorctrl.cpp | 31 +++++++--------------------
 1 file changed, 8 insertions(+), 23 deletions(-)

diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp
index 80477c1041b..47e519df8db 100644
--- a/indra/newview/lloutputmonitorctrl.cpp
+++ b/indra/newview/lloutputmonitorctrl.cpp
@@ -279,34 +279,19 @@ void LLOutputMonitorCtrl::onChange()
 // virtual
 void LLOutputMonitorCtrl::switchIndicator(bool switch_on)
 {
-	if (switch_on)
+	setVisible(TRUE);
+
+	if (getParent() && getParent()->isInVisibleChain())
 	{
+		LL_DEBUGS("SpeakingIndicator") << "Indicator is in visible chain, notifying parent: " << mSpeakerId << LL_ENDL;
 		setVisible((BOOL)switch_on);
-		if (getParent() && getParent()->isInVisibleChain())
-		{
-			notifyParentVisibilityChanged();
-		}
-		else
-		{
-			LL_DEBUGS("SpeakingIndicator") << "Indicator is not in visible chain, parent won't be notified: " << mSpeakerId << LL_ENDL;
-			mIsSwitchDirty = true;
-			mShouldSwitchOn = true;
-		}
+		notifyParentVisibilityChanged();
 	}
 	else
 	{
-		if (getParent() && getParent()->isInVisibleChain())
-		{
-			LL_DEBUGS("SpeakingIndicator") << "Indicator is in visible chain, notifying parent: " << mSpeakerId << LL_ENDL;
-			setVisible((BOOL)switch_on);
-			notifyParentVisibilityChanged();
-		}
-		else
-		{
-			LL_DEBUGS("SpeakingIndicator") << "Indicator is not in visible chain, parent won't be notified: " << mSpeakerId << LL_ENDL;
-			mIsSwitchDirty = true;
-			mShouldSwitchOn = false;
-		}
+		LL_DEBUGS("SpeakingIndicator") << "Indicator is not in visible chain, parent won't be notified: " << mSpeakerId << LL_ENDL;
+		mIsSwitchDirty = true;
+		mShouldSwitchOn = switch_on;
 	}
 }
 
-- 
GitLab