From f043bc32fd202de88d6823bb938128147ab4a04c Mon Sep 17 00:00:00 2001
From: MaximB ProductEngine <mberezhnoy@productengine.com>
Date: Mon, 19 Nov 2012 09:08:02 +0200
Subject: [PATCH] CHUI-434 (Don't display phone icon and disable phone button
 when voice isn't enabled)

---
 indra/newview/llconversationview.cpp | 20 +++++++-------------
 indra/newview/llconversationview.h   |  2 +-
 2 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index 4c52794e4ce..b9d62e85c46 100755
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -57,14 +57,11 @@ class LLNearbyVoiceClientStatusObserver : public LLVoiceClientStatusObserver
 
 	virtual void onChange(EStatusType status, const std::string &channelURI, bool proximal)
 	{
-		if (conversation
-		   && status != STATUS_JOINING
-		   && status != STATUS_LEFT_CHANNEL
-		   && LLVoiceClient::getInstance()->voiceEnabled()
-		   && LLVoiceClient::getInstance()->isVoiceWorking())
-		{
-			conversation->showVoiceIndicator();
-		}
+		conversation->showVoiceIndicator(conversation
+			&& status != STATUS_JOINING
+			&& status != STATUS_LEFT_CHANNEL
+			&& LLVoiceClient::getInstance()->voiceEnabled()
+			&& LLVoiceClient::getInstance()->isVoiceWorking());
 	}
 
 private:
@@ -288,12 +285,9 @@ LLConversationViewParticipant* LLConversationViewSession::findParticipant(const
 	return (iter == getItemsEnd() ? NULL : participant);
 }
 
-void LLConversationViewSession::showVoiceIndicator()
+void LLConversationViewSession::showVoiceIndicator(bool visible)
 {
-	if (LLVoiceChannel::getCurrentVoiceChannel()->getSessionID().isNull())
-	{
-		mCallIconLayoutPanel->setVisible(true);
-	}
+	mCallIconLayoutPanel->setVisible(visible && LLVoiceChannel::getCurrentVoiceChannel()->getSessionID().isNull());
 }
 
 void LLConversationViewSession::refresh()
diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h
index 1baa8bb5ec5..8156b746b21 100755
--- a/indra/newview/llconversationview.h
+++ b/indra/newview/llconversationview.h
@@ -78,7 +78,7 @@ class LLConversationViewSession : public LLFolderViewFolder
 	void setVisibleIfDetached(BOOL visible);
 	LLConversationViewParticipant* findParticipant(const LLUUID& participant_id);
 
-	void showVoiceIndicator();
+	void showVoiceIndicator(bool visible);
 
 	virtual void refresh();
 
-- 
GitLab