From 953b8ed694c2b5a2762e829e2ecf56fe07c23619 Mon Sep 17 00:00:00 2001
From: Rider Linden <rider@lindenlab.com>
Date: Wed, 24 Feb 2016 11:48:11 -0800
Subject: [PATCH] MAINT-6096: For non-spacial voice chats update the volume of
 participants. Rename "sendPositionalUpdate" to reflect volume changes.

---
 indra/newview/llvoicevivox.cpp | 10 +++++-----
 indra/newview/llvoicevivox.h   |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 24a775ca42c..c8bfc63a6a1 100755
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -1253,7 +1253,7 @@ bool LLVivoxVoiceClient::addAndJoinSession(const sessionStatePtr_t &nextSession)
     mSpeakerVolumeDirty = true;
     mSpatialCoordsDirty = true;
 
-    sendPositionalUpdate();
+    sendPositionAndVolumeUpdate();
 
     notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_JOINED);
 
@@ -1501,8 +1501,8 @@ bool LLVivoxVoiceClient::runSession(const sessionStatePtr_t &session)
             }
             // Do the calculation that enforces the listener<->speaker tether (and also updates the real camera position)
             enforceTether();
-            sendPositionalUpdate();
         }
+        sendPositionAndVolumeUpdate();
 
         // Do notifications for expiring Voice Fonts.
         if (mVoiceFontExpiryTimer.hasExpired())
@@ -2443,15 +2443,15 @@ void LLVivoxVoiceClient::setHidden(bool hidden)
 {
     mHidden = hidden;
     
-    sendPositionalUpdate();
+    sendPositionAndVolumeUpdate();
     return;
 }
 
-void LLVivoxVoiceClient::sendPositionalUpdate(void)
+void LLVivoxVoiceClient::sendPositionAndVolumeUpdate(void)
 {	
 	std::ostringstream stream;
 	
-	if(mSpatialCoordsDirty)
+	if (mSpatialCoordsDirty && inSpatialChannel())
 	{
 		LLVector3 l, u, a, vel;
 		LLVector3d pos;
diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h
index 3b867891088..176f7f56dcd 100755
--- a/indra/newview/llvoicevivox.h
+++ b/indra/newview/llvoicevivox.h
@@ -747,7 +747,7 @@ class LLVivoxVoiceClient :	public LLSingleton<LLVivoxVoiceClient>,
 	std::string getAudioSessionHandle();
 			
     void setHidden(bool hidden); //virtual
-	void sendPositionalUpdate(void);
+	void sendPositionAndVolumeUpdate(void);
 	
 	void buildSetCaptureDevice(std::ostringstream &stream);
 	void buildSetRenderDevice(std::ostringstream &stream);
-- 
GitLab