summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2026-05-13 20:23:41 +0300
committerAndrey Lihatskiy <118752495+marchcat@users.noreply.github.com>2026-05-14 21:03:15 +0300
commit35b7766beed50d87fab486a3064218e434ef36fb (patch)
tree88aa56b0609e7e3900b5741c55176fe9f8a9e3cb
parentb85695a6d260122c731a2565945b8dc351a180db (diff)
#5804 Prevent group chat focus steal when opening adhoc IM
-rw-r--r--indra/newview/llfloaterimcontainer.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index a0f2dbe197..21f1ed831d 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -155,15 +155,23 @@ 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;
+ }
}