From fa54b50e029c963d90b5533174a29eefc22227e5 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Sat, 26 Jan 2013 00:19:29 +0000
Subject: CHUI-644 FIX [CHUIBUG]Received IM's Don't Always Appear in
 Communication Console Immediately. Added call to
 LLFloaterIMContainer::selectConversation() in on_new_message for LLIMView

---
 indra/newview/llimview.cpp | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

(limited to 'indra')

diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index cb03c1d234..c94f2e967e 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -144,7 +144,7 @@ static void on_avatar_name_cache_toast(const LLUUID& agent_id,
 	args["FROM"] = av_name.getCompleteName();
 	args["FROM_ID"] = msg["from_id"];
 	args["SESSION_ID"] = msg["session_id"];
-	LLNotificationsUtil::add("IMToast", args, args, boost::bind(&LLFloaterIMContainer::showConversation, LLFloaterIMContainer::getInstance(), msg["session_id"].asUUID()));
+	LLNotificationsUtil::add("IMToast", args, LLSD(), boost::bind(&LLFloaterIMContainer::showConversation, LLFloaterIMContainer::getInstance(), msg["session_id"].asUUID()));
 }
 
 void on_new_message(const LLSD& msg)
@@ -239,6 +239,12 @@ void on_new_message(const LLSD& msg)
                 {
                     LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg));
                 }
+
+				// Make sure the message actually appears, without having to click on the conversation
+				if(!conversation_floater_is_closed)
+				{
+					im_box->selectConversation(session_id);
+				}
             }
         }
     }
@@ -276,9 +282,9 @@ void on_new_message(const LLSD& msg)
 
             if(!gAgent.isDoNotDisturb())
             {
-            //Surface conversations floater
-            LLFloaterReg::showInstance("im_container");
-        }
+				//Surface conversations floater
+				LLFloaterReg::showInstance("im_container");
+			}
 
             //If in DND mode, allow notification to be stored so upon DND exit 
             //useMostItrusiveIMNotification will be called to notify user a message exists
@@ -287,8 +293,8 @@ void on_new_message(const LLSD& msg)
                 && gAgent.isDoNotDisturb())
             {
                 LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg));
-    }
-}
+			}
+		}
     }
 }
 
-- 
cgit v1.2.3