From 7f3f5cc408d7b36478c7dd707e32f921c1e1b720 Mon Sep 17 00:00:00 2001
From: AlexanderP ProductEngine <apaschenko@productengine.com>
Date: Wed, 3 Oct 2012 16:56:27 +0300
Subject: [PATCH] CHUI-378 FIXED (Conversation floater is not opened if call
 initiated and accepted with conversation floater closed - goes to voice
 settings floater): added open conversation floater on the voice channel's
 changing

---
 indra/newview/llappviewer.cpp          |  3 ++-
 indra/newview/llcallfloater.cpp        |  3 ++-
 indra/newview/llcallfloater.h          |  4 ++--
 indra/newview/llimfloatercontainer.cpp | 10 ++++++++++
 indra/newview/llimfloatercontainer.h   |  4 ++--
 5 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 08a1a237f5f..6b15e4b21a2 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -42,6 +42,7 @@
 #include "llagentcamera.h"
 #include "llagentlanguage.h"
 #include "llagentwearables.h"
+#include "llimfloatercontainer.h"
 #include "llwindow.h"
 #include "llviewerstats.h"
 #include "llviewerstatsrecorder.h"
@@ -1204,7 +1205,7 @@ bool LLAppViewer::mainLoop()
 
 	LLVoiceChannel::initClass();
 	LLVoiceClient::getInstance()->init(gServicePump);
-	LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLCallFloater::sOnCurrentChannelChanged, _1), true);
+	LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLIMFloaterContainer::onCurrentChannelChanged, _1), true);
 	LLTimer frameTimer,idleTimer;
 	LLTimer debugTime;
 	LLViewerJoystick* joystick(LLViewerJoystick::getInstance());
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp
index 38b755004ca..e767609d74b 100644
--- a/indra/newview/llcallfloater.cpp
+++ b/indra/newview/llcallfloater.cpp
@@ -364,7 +364,8 @@ void LLCallFloater::onAvatarListRefreshed()
 }
 
 // static
-void LLCallFloater::sOnCurrentChannelChanged(const LLUUID& /*session_id*/)
+// This entry point now disable, but left for later use.
+void LLCallFloater::onCurrentChannelChanged(const LLUUID& /*session_id*/)
 {
 	LLVoiceChannel* channel = LLVoiceChannel::getCurrentVoiceChannel();
 
diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h
index 181c92276d0..e1c7b3f43ad 100644
--- a/indra/newview/llcallfloater.h
+++ b/indra/newview/llcallfloater.h
@@ -74,7 +74,7 @@ class LLCallFloater : public LLTransientDockableFloater, LLVoiceClientParticipan
 	 */
 	/*virtual*/ void onParticipantsChanged();
 
-	static void sOnCurrentChannelChanged(const LLUUID& session_id);
+	static void onCurrentChannelChanged(const LLUUID& session_id);
 
 private:
 	typedef enum e_voice_controls_type
@@ -260,7 +260,7 @@ class LLCallFloater : public LLTransientDockableFloater, LLVoiceClientParticipan
 	 *
 	 * Is used to ignore voice channel changed callback for the same channel.
 	 *
-	 * @see sOnCurrentChannelChanged()
+	 * @see onCurrentChannelChanged()
 	 */
 	static LLVoiceChannel* sCurrentVoiceChannel;
 
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index 237748179cb..5a323583b89 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -114,6 +114,16 @@ void LLIMFloaterContainer::sessionRemoved(const LLUUID& session_id)
 	removeConversationListItem(session_id);
 }
 
+// static
+void LLIMFloaterContainer::onCurrentChannelChanged(const LLUUID& session_id)
+{
+    if (session_id != LLUUID::null)
+    {
+    	LLIMFloater::show(session_id);
+    }
+}
+
+
 BOOL LLIMFloaterContainer::postBuild()
 {
 	mNewMessageConnection = LLIMModel::instance().mNewMsgSignal.connect(boost::bind(&LLIMFloaterContainer::onNewMessageReceived, this, _1));
diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h
index a622ddfc8c7..081c7338847 100644
--- a/indra/newview/llimfloatercontainer.h
+++ b/indra/newview/llimfloatercontainer.h
@@ -66,11 +66,11 @@ class LLIMFloaterContainer
 	/*virtual*/ void tabClose();
 
 	static LLFloater* getCurrentVoiceFloater();
-
 	static LLIMFloaterContainer* findInstance();
-
 	static LLIMFloaterContainer* getInstance();
 
+	static void onCurrentChannelChanged(const LLUUID& session_id);
+
 	virtual void setMinimized(BOOL b);
 
 	void collapseMessagesPane(bool collapse);
-- 
GitLab