From ac778f69ee33d31b60ec190c3bcd84c026e41602 Mon Sep 17 00:00:00 2001
From: Armin Weatherwax
Date: Sun, 13 Mar 2011 09:16:20 +0100
Subject: fix voice doesn't kick in.

also fixed some LL_INFOS that should be LL_WARNS in the voice client.

(cherry picked from commit 56bf45f3493689b5eb60cf99580adf11d6b02508)
---
 linden/indra/newview/llvoiceclient.cpp | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

(limited to 'linden')

diff --git a/linden/indra/newview/llvoiceclient.cpp b/linden/indra/newview/llvoiceclient.cpp
index d67b9e3..a6cec7b 100644
--- a/linden/indra/newview/llvoiceclient.cpp
+++ b/linden/indra/newview/llvoiceclient.cpp
@@ -1527,12 +1527,10 @@ void LLVoiceClient::setState(state inState)
 
 void LLVoiceClient::stateMachine()
 {
-	if(gDisconnected)
-	{
-		// The viewer has been disconnected from the sim.  Disable voice.
-		setVoiceEnabled(false);
-	}
-	
+
+	// Disable voice as long as the viewer is disconnected from the sim (login/relog)
+	setVoiceEnabled(!gDisconnected);
+
 	if(mVoiceEnabled)
 	{
 		updatePosition();
@@ -1549,7 +1547,7 @@ void LLVoiceClient::stateMachine()
 			if(!mConnected)
 			{
 				// if voice was turned off after the daemon was launched but before we could connect to it, we may need to issue a kill.
-				LL_INFOS("Voice") << "Disabling voice before connection to daemon, terminating." << LL_ENDL;
+				LL_WARNS("Voice") << "Disabling voice before connection to daemon, terminating." << LL_ENDL;
 				killGateway();
 			}
 			
@@ -1753,7 +1751,7 @@ void LLVoiceClient::stateMachine()
 					}	
 					else
 					{
-						LL_INFOS("Voice") << exe_path << " not found." << LL_ENDL;
+						LL_WARNS("Voice") << exe_path << " not found." << LL_ENDL;
 						mVoiceEnabled = false;
 					}	
 				}
@@ -3772,7 +3770,7 @@ void LLVoiceClient::loginResponse(int statusCode, std::string &statusString, std
 	if ( statusCode == 401 )
 	{
 		// Login failure which is probably caused by the delay after a user's password being updated.
-		LL_INFOS("Voice") << "Account.Login response failure (" << statusCode << "): " << statusString << LL_ENDL;
+		LL_WARNS("Voice") << "Account.Login response failure (" << statusCode << "): " << statusString << LL_ENDL;
 		setState(stateLoginRetry);
 	}
 	else if(statusCode != 0)
@@ -3950,7 +3948,7 @@ void LLVoiceClient::sessionAddedEvent(
 			}
 			else
 			{
-				LL_INFOS("Voice") << "Could not generate caller id from uri, using hash of uri " << session->mSIPURI << LL_ENDL;
+				LL_WARNS("Voice") << "Could not generate caller id from uri, using hash of uri " << session->mSIPURI << LL_ENDL;
 				setUUIDFromStringHash(session->mCallerID, session->mSIPURI);
 				session->mSynthesizedCallerID = true;
 				
@@ -4468,7 +4466,7 @@ void LLVoiceClient::participantUpdatedEvent(
 	}
 	else
 	{
-		LL_INFOS("Voice") << "unknown session " << sessionHandle << LL_ENDL;
+		LL_WARNS("Voice") << "unknown session " << sessionHandle << LL_ENDL;
 	}
 }
 
@@ -5062,7 +5060,7 @@ void LLVoiceClient::parcelChanged()
 	else
 	{
 		// The transition to stateNoChannel needs to kick this off again.
-		LL_INFOS("Voice") << "not logged in yet, deferring" << LL_ENDL;
+		LL_WARNS("Voice") << "not logged in yet, deferring" << LL_ENDL;
 	}
 }
 
-- 
cgit v1.1