From 6a28667e93c2fd66ce5d47fadc7700574d58fdfa Mon Sep 17 00:00:00 2001
From: Mike Antipov <mantipov@productengine.com>
Date: Fri, 25 Dec 2009 18:40:48 +0200
Subject: [PATCH] Fixed low bug EXT-3543 ("Mute this participant" menu should
 be disabled for non-connected participants) -- added validating of the
 speaker status while showing voice moderation menu items

--HG--
branch : product-engine
---
 indra/newview/llparticipantlist.cpp | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp
index e320886ad2a..54a837d17df 100644
--- a/indra/newview/llparticipantlist.cpp
+++ b/indra/newview/llparticipantlist.cpp
@@ -577,10 +577,23 @@ bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD&
 	{
 		return mUUIDs.front() != gAgentID;
 	}
-	else if (item == "can_allow_text_chat" || "can_moderate_voice" == item)
+	else if (item == "can_allow_text_chat")
 	{
 		return isGroupModerator();
 	}
+	else if ("can_moderate_voice" == item)
+	{
+		if (isGroupModerator())
+		{
+			LLPointer<LLSpeaker> speakerp = mParent.mSpeakerMgr->findSpeaker(mUUIDs.front());
+			if (speakerp.notNull())
+			{
+				// not in voice participants can not be moderated
+				return speakerp->mStatus != LLSpeaker::STATUS_TEXT_ONLY;
+			}
+		}
+		return false;
+	}
 	else if (item == std::string("can_add"))
 	{
 		// We can add friends if:
-- 
GitLab