diff options
| author | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2026-08-14 19:08:11 -0400 |
|---|---|---|
| committer | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2026-08-14 19:08:11 -0400 |
| commit | 66ff4c75bc2d594a41dfe22d85139311567b8e97 (patch) | |
| tree | 08eec3889838cebf272e10ee34153a91667d4781 /indra/newview/llfloaterimcontainer.cpp | |
| parent | 0a32098d4a603bc2a25fc68bbeaa1e980f0c1fe1 (diff) | |
| parent | 305bebbdb3b16b10b6011b5b3b5d63ee7c7334be (diff) | |
Merge branch 'project/lua_editor' into pepper/pchat-revamp
Diffstat (limited to 'indra/newview/llfloaterimcontainer.cpp')
| -rw-r--r-- | indra/newview/llfloaterimcontainer.cpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 9aa2382e09..91201e5770 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -156,18 +156,36 @@ void LLFloaterIMContainer::sessionIDUpdated(const LLUUID& old_session_id, const { // The general strategy when a session id is modified is to delete all related objects and create them anew. + // The conversation floater can be active while participant widgets are selected. + // Preserve that state separately so the new conversation widget can be selected + // after the server replaces an outgoing ad-hoc session id. + const bool was_active = old_session_id == getSelectedSession(); + // 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); + } } |
