summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterimcontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterimcontainer.cpp')
-rw-r--r--indra/newview/llfloaterimcontainer.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index f8f34ca12e..e466090624 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -163,16 +163,24 @@ void LLFloaterIMContainer::sessionIDUpdated(const LLUUID& old_session_id, const
// Note however that the LLFloaterIMSession has its session id updated through a call to sessionInitReplyReceived()
// and do not need to be deleted and recreated (trying this creates loads of problems). We do need however to suppress
// its related mSessions record as it's indexed with the wrong id.
- // Grabbing the updated LLFloaterIMSession and readding it in mSessions will eventually be done by addConversationListItem().
mSessions.erase(old_session_id);
- // Delete the model and participants related to the old session
- bool change_focus = removeConversationListItem(old_session_id);
+ // Remove the old conversation widget without changing focus - we'll immediately re-add with
+ // the new id and select it, avoiding an unnecessary focus switch to an adjacent conversation.
+ bool was_selected = removeConversationListItem(old_session_id, false);
// Create a new conversation with the new id
- addConversationListItem(new_session_id, change_focus);
+ addConversationListItem(new_session_id, was_selected);
LLFloaterIMSessionTab::addToHost(new_session_id);
+ // addToHost is a no-op for already-hosted floaters, so mSessions won't be
+ // updated by addFloater. Re-register manually so message flash works.
+ LLFloaterIMSessionTab* conversp = LLFloaterIMSessionTab::findConversation(new_session_id);
+ if (conversp && mSessions.find(new_session_id) == mSessions.end())
+ {
+ mSessions[new_session_id] = conversp;
+ }
+
if (was_active)
{
selectConversationPair(new_session_id, true, false, true);
@@ -2371,7 +2379,7 @@ bool LLFloaterIMContainer::isNearbyChatSpeakerSelected()
if (!selectedItem)
{
LL_WARNS() << "Current selected item is null" << LL_ENDL;
- return NULL;
+ return false;
}
conversations_widgets_map::const_iterator iter = mConversationsWidgets.begin();