From 1a1a0b91c0c4400ec3febac183124314f9226127 Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Fri, 26 Oct 2012 16:49:22 -0700
Subject: [PATCH] CHUI-383: Realized that prior changes for this bug caused a
 regress. The regress was using the people panel or a notecard to start a
 im/call with a user. When doing this the conversation line item would not be
 focused. Resolution: Changed all calls to LLIMFloater::show() to
 LLIMFloaterContainer::showConversation(), which will first select the
 conversation line item and then show the corresponding conversation floater.

---
 indra/newview/llavataractions.cpp      | 6 +++---
 indra/newview/llchiclet.cpp            | 3 ++-
 indra/newview/llgroupactions.cpp       | 4 ++--
 indra/newview/llimfloatercontainer.cpp | 2 +-
 indra/newview/llinventorybridge.cpp    | 4 ++--
 indra/newview/llinventorypanel.cpp     | 4 ++--
 6 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 7322b3bb0b2..13262efb3bd 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -56,6 +56,7 @@
 #include "llinventorybridge.h"
 #include "llinventorymodel.h"	// for gInventory.findCategoryUUIDForType
 #include "llinventorypanel.h"
+#include "llimfloatercontainer.h"
 #include "llimview.h"			// for gIMMgr
 #include "llmutelist.h"
 #include "llnotificationsutil.h"	// for LLNotificationsUtil
@@ -67,7 +68,6 @@
 #include "llviewerobjectlist.h"
 #include "llviewermessage.h"	// for handle_lure
 #include "llviewerregion.h"
-#include "llimfloater.h"
 #include "lltrans.h"
 #include "llcallingcard.h"
 #include "llslurl.h"			// IDEVO
@@ -184,7 +184,7 @@ static void on_avatar_name_cache_start_im(const LLUUID& agent_id,
 	LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, agent_id);
 	if (session_id != LLUUID::null)
 	{
-		LLIMFloater::show(session_id);
+		LLIMFloaterContainer::getInstance()->showConversation(session_id);
 	}
 	make_ui_sound("UISndStartIM");
 }
@@ -302,7 +302,7 @@ void LLAvatarActions::startConference(const uuid_vec_t& ids, const LLUUID& float
 		return;
 	}
 	
-	LLIMFloater::show(session_id);
+	LLIMFloaterContainer::getInstance()->showConversation(session_id);
 	
 	make_ui_sound("UISndStartIM");
 }
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index 17181edffce..e328186fd67 100644
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -34,6 +34,7 @@
 #include "llgroupactions.h"
 #include "lliconctrl.h"
 #include "llimfloater.h"
+#include "llimfloatercontainer.h"
 #include "llimview.h"
 #include "llfloaterreg.h"
 #include "lllocalcliprect.h"
@@ -1196,7 +1197,7 @@ void LLChicletPanel::onCurrentVoiceChannelChanged(const LLUUID& session_id)
 			chiclet->setShowSpeaker(true);
 			if (gSavedSettings.getBOOL("OpenIMOnVoice"))
 			{
-				LLIMFloater::show(chiclet->getSessionId());
+				LLIMFloaterContainer::getInstance()->showConversation(session_id);
 			}
 		}
 	}
diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp
index 623ebb76f2b..15eca39bced 100644
--- a/indra/newview/llgroupactions.cpp
+++ b/indra/newview/llgroupactions.cpp
@@ -36,10 +36,10 @@
 #include "llfloaterreg.h"
 #include "llfloatersidepanelcontainer.h"
 #include "llgroupmgr.h"
+#include "llimfloatercontainer.h"
 #include "llimview.h" // for gIMMgr
 #include "llnotificationsutil.h"
 #include "llstatusbar.h"	// can_afford_transaction()
-#include "llimfloater.h"
 #include "groupchatlistener.h"
 
 //
@@ -335,7 +335,7 @@ LLUUID LLGroupActions::startIM(const LLUUID& group_id)
 			group_id);
 		if (session_id != LLUUID::null)
 		{
-			LLIMFloater::show(session_id);
+			LLIMFloaterContainer::getInstance()->showConversation(session_id);
 		}
 		make_ui_sound("UISndStartIM");
 		return session_id;
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index 6377ffeecf3..4d2201ebb97 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -128,7 +128,7 @@ void LLIMFloaterContainer::onCurrentChannelChanged(const LLUUID& session_id)
 {
     if (session_id != LLUUID::null)
     {
-    	LLIMFloater::show(session_id);
+    	LLIMFloaterContainer::getInstance()->showConversation(session_id);
     }
 }
 
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 28c2edbe840..5d8d82b226a 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -46,7 +46,7 @@
 #include "llfriendcard.h"
 #include "llgesturemgr.h"
 #include "llgiveinventory.h" 
-#include "llimfloater.h"
+#include "llimfloatercontainer.h"
 #include "llimview.h"
 #include "llclipboard.h"
 #include "llinventorydefines.h"
@@ -4704,7 +4704,7 @@ void LLCallingCardBridge::performAction(LLInventoryModel* model, std::string act
 			LLUUID session_id = gIMMgr->addSession(callingcard_name, IM_NOTHING_SPECIAL, item->getCreatorUUID());
 			if (session_id != LLUUID::null)
 			{
-				LLIMFloater::show(session_id);
+				LLIMFloaterContainer::getInstance()->showConversation(session_id);
 			}
 		}
 	}
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index a8d99ad7de8..dafc71b59cd 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -39,7 +39,7 @@
 #include "llfloatersidepanelcontainer.h"
 #include "llfolderview.h"
 #include "llfolderviewitem.h"
-#include "llimfloater.h"
+#include "llimfloatercontainer.h"
 #include "llimview.h"
 #include "llinventorybridge.h"
 #include "llinventoryfunctions.h"
@@ -1087,7 +1087,7 @@ bool LLInventoryPanel::beginIMSession()
 	LLUUID session_id = gIMMgr->addSession(name, type, members[0], members);
 	if (session_id != LLUUID::null)
 	{
-		LLIMFloater::show(session_id);
+		LLIMFloaterContainer::getInstance()->showConversation(session_id);
 	}
 		
 	return true;
-- 
GitLab