summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterimcontainer.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2026-08-18 13:57:14 +0800
committerErik Kundiman <erik@megapahit.org>2026-08-18 13:57:14 +0800
commit2fa8281b2d8ce8bdbcacf139ec674480da6c9d81 (patch)
treeffb343fee97f21942123fd322d88fea3ef1a4811 /indra/newview/llfloaterimcontainer.cpp
parent742d802f073e81abc6d4cd512e58a4d03b414b83 (diff)
parent214fa765986b4c1e1de1b917581f8508278abd8e (diff)
Merge branch '26.3'
Diffstat (limited to 'indra/newview/llfloaterimcontainer.cpp')
-rw-r--r--indra/newview/llfloaterimcontainer.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 04327e30bd..f8f34ca12e 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -155,6 +155,11 @@ 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.
@@ -167,6 +172,11 @@ void LLFloaterIMContainer::sessionIDUpdated(const LLUUID& old_session_id, const
// Create a new conversation with the new id
addConversationListItem(new_session_id, change_focus);
LLFloaterIMSessionTab::addToHost(new_session_id);
+
+ if (was_active)
+ {
+ selectConversationPair(new_session_id, true, false, true);
+ }
}
@@ -1734,7 +1744,7 @@ bool LLFloaterIMContainer::visibleContextMenuItem(const LLSD& userdata)
void LLFloaterIMContainer::showConversation(const LLUUID& session_id)
{
setVisibleAndFrontmost(false);
- selectConversationPair(session_id, true);
+ selectConversationPair(session_id, true, true, true);
LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::findConversation(session_id);
if (session_floater)
@@ -1780,13 +1790,13 @@ void LLFloaterIMContainer::selectNextConversationByID(const LLUUID& uuid)
}
// Synchronous select the conversation item and the conversation floater
-bool LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool select_widget, bool focus_floater/*=true*/)
+bool LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool select_widget, bool focus_floater/*=true*/, bool force_select_widget/*=false*/)
{
bool handled = true;
LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::findConversation(session_id);
/* widget processing */
- if (select_widget && mConversationsRoot->getSelectedCount() <= 1)
+ if (select_widget && (force_select_widget || mConversationsRoot->getSelectedCount() <= 1))
{
LLFolderViewItem* widget = get_ptr_in_map(mConversationsWidgets,session_id);
if (widget && widget->getParentFolder())
@@ -1990,7 +2000,7 @@ bool LLFloaterIMContainer::removeConversationListItem(const LLUUID& uuid, bool c
mConversationEventQueue.erase(uuid);
// Don't let the focus fall IW, select and refocus on the first conversation in the list
- if (change_focus && isInVisibleChain())
+ if (change_focus && is_widget_selected && isInVisibleChain())
{
setFocus(true);
if (new_selection)