From 7048679ac8c6cea9238c1602d75ead4d983cdbc0 Mon Sep 17 00:00:00 2001
From: andreykproductengine <akleshchev@productengine.com>
Date: Thu, 10 Sep 2015 16:16:50 +0300
Subject: [PATCH] MAINT-5584 FIXED On voice disabled parcel or region, speak
 button remains disabled in ad-hoc and group voice calls - you can hear but
 not speak.

---
 indra/newview/llagent.cpp | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 297bd9a05bc..3f32be1d68a 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -275,9 +275,24 @@ bool LLAgent::isActionAllowed(const LLSD& sdname)
 
 	if (param == "speak")
 	{
-		if ( gAgent.isVoiceConnected() && 
-			LLViewerParcelMgr::getInstance()->allowAgentVoice() &&
-				! LLVoiceClient::getInstance()->inTuningMode() )
+        bool allow_agent_voice = false;
+        LLVoiceChannel* channel = LLVoiceChannel::getCurrentVoiceChannel();
+        if (channel != NULL)
+        {
+            if (channel->getSessionName().empty() && channel->getSessionID().isNull())
+            {
+                // default channel
+                allow_agent_voice = LLViewerParcelMgr::getInstance()->allowAgentVoice();
+            }
+            else
+            {
+                allow_agent_voice = channel->isActive() && channel->callStarted();
+            }
+        }
+
+        if (gAgent.isVoiceConnected() &&
+            allow_agent_voice &&
+            !LLVoiceClient::getInstance()->inTuningMode())
 		{
 			retval = true;
 		}
-- 
GitLab