From fd077d8a9b5e2a5d3971b4bcae06f5ee39e6c53b Mon Sep 17 00:00:00 2001
From: Roxie Linden <roxie@lindenlab.com>
Date: Sat, 3 Feb 2024 20:41:40 -0800
Subject: small logic errors in mute/volume for others code

---
 indra/newview/llvoicewebrtc.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

(limited to 'indra')

diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index e59e267d31..a3f874aacf 100644
--- a/indra/newview/llvoicewebrtc.cpp
+++ b/indra/newview/llvoicewebrtc.cpp
@@ -918,6 +918,10 @@ void LLWebRTCVoiceClient::sessionState::setSpeakerVolume(F32 volume)
 
 void LLWebRTCVoiceClient::sessionState::setUserVolume(const LLUUID& id, F32 volume)
 {
+    if (mParticipantsByUUID.find(id) == mParticipantsByUUID.end())
+    {
+        return;
+    }
     for (auto& connection : mWebRTCConnections)
     {
         connection->setUserVolume(id, volume);
@@ -926,7 +930,7 @@ void LLWebRTCVoiceClient::sessionState::setUserVolume(const LLUUID& id, F32 volu
 
 void LLWebRTCVoiceClient::sessionState::setUserMute(const LLUUID& id, bool mute)
 {
-    if (mParticipantsByUUID.find(id) != mParticipantsByUUID.end())
+    if (mParticipantsByUUID.find(id) == mParticipantsByUUID.end())
     {
         return;
     }
@@ -2582,7 +2586,7 @@ void LLVoiceWebRTCConnection::setUserVolume(const LLUUID& id, F32 volume)
 {
     Json::Value root = Json::objectValue;
     Json::Value user_gain = Json::objectValue;
-    user_gain[id.asString()] = (uint32_t)volume*100;
+    user_gain[id.asString()] = (uint32_t)(volume*100);
     root["ug"] = user_gain;
     Json::FastWriter writer;
     std::string json_data = writer.write(root);
-- 
cgit v1.2.3