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.cpp29
1 files changed, 19 insertions, 10 deletions
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index ec1068d191..aebfdb5bce 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -98,6 +98,7 @@ LLFloaterIMContainer::~LLFloaterIMContainer()
void LLFloaterIMContainer::sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id, BOOL has_offline_msg)
{
+ llinfos << "Merov debug : sessionAdded, uuid = " << session_id << ", name = " << name << llendl;
addConversationListItem(session_id);
LLFloaterIMSessionTab::addToHost(session_id);
}
@@ -115,8 +116,20 @@ void LLFloaterIMContainer::sessionVoiceOrIMStarted(const LLUUID& session_id)
void LLFloaterIMContainer::sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id)
{
- // *TODO: We should do this *without* delete and recreate
- addConversationListItem(new_session_id, removeConversationListItem(old_session_id));
+ // The general strategy when a session id is modified is to delete all related objects and create them anew.
+
+ // 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);
+
+ // Create a new conversation with the new id
+ addConversationListItem(new_session_id, change_focus);
+ LLFloaterIMSessionTab::addToHost(new_session_id);
}
void LLFloaterIMContainer::sessionRemoved(const LLUUID& session_id)
@@ -463,14 +476,14 @@ bool LLFloaterIMContainer::onConversationModelEvent(const LLSD& event)
else if (type == "update_session")
{
session_view->refresh();
- if (conversation_floater)
- {
- conversation_floater->refreshConversation();
- }
}
mConversationViewModel.requestSortAll();
mConversationsRoot->arrangeAll();
+ if (conversation_floater)
+ {
+ conversation_floater->refreshConversation();
+ }
return false;
}
@@ -1236,10 +1249,6 @@ LLConversationItem* LLFloaterIMContainer::addConversationListItem(const LLUUID&
return item_it->second;
}
- // Remove the conversation item that might exist already: it'll be recreated anew further down anyway
- // and nothing wrong will happen removing it if it doesn't exist
- removeConversationListItem(uuid,false);
-
// Create a conversation session model
LLConversationItemSession* item = NULL;
LLSpeakerMgr* speaker_manager = (is_nearby_chat ? (LLSpeakerMgr*)(LLLocalSpeakerMgr::getInstance()) : LLIMModel::getInstance()->getSpeakerManager(uuid));