summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llimfloater.cpp8
-rw-r--r--indra/newview/llimfloater.h4
-rw-r--r--indra/newview/llimfloatercontainer.cpp19
-rw-r--r--indra/newview/llimfloatercontainer.h2
4 files changed, 18 insertions, 15 deletions
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index e4032738a7..29e84e1332 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -582,7 +582,7 @@ void LLIMFloater::onParticipantsListChanged(LLUICtrl* ctrl)
}
}
-void LLIMFloater::addToHost(const LLUUID& session_id, const bool force)
+void LLIMFloater::addToHost(const LLUUID& session_id, LLConversationItemSession* session_root_model, const bool force)
{
if (!LLIMConversation::isChatMultiTab() || !gIMMgr->hasSession(session_id))
{
@@ -593,7 +593,7 @@ void LLIMFloater::addToHost(const LLUUID& session_id, const bool force)
bool exist = findInstance(session_id);
// Get the floater: this will create the instance if it didn't exist
- LLIMFloater* floater = getInstance(session_id);
+ LLIMFloater* floater = getInstance(session_id, session_root_model);
if (floater)
{
@@ -672,11 +672,12 @@ LLIMFloater* LLIMFloater::findInstance(const LLUUID& session_id)
return conversation;
}
-LLIMFloater* LLIMFloater::getInstance(const LLUUID& session_id)
+LLIMFloater* LLIMFloater::getInstance(const LLUUID& session_id, LLConversationItemSession* session_root_model)
{
LLIMFloater* conversation =
LLFloaterReg::getTypedInstance<LLIMFloater>("impanel", session_id);
+ conversation->setSessionRoot(session_root_model);
return conversation;
}
@@ -1322,6 +1323,7 @@ void LLIMFloater::sRemoveTypingIndicator(const LLSD& data)
floater->removeTypingIndicator();
}
+// CHUI-441 : We should not create a floater here but go through LLIMFLoaterContainer
void LLIMFloater::onIMChicletCreated( const LLUUID& session_id )
{
LLIMFloater::addToHost(session_id);
diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h
index 26daf00afd..fd08612c32 100644
--- a/indra/newview/llimfloater.h
+++ b/indra/newview/llimfloater.h
@@ -71,8 +71,8 @@ public:
// Check typing timeout timer.
static LLIMFloater* findInstance(const LLUUID& session_id);
- static LLIMFloater* getInstance(const LLUUID& session_id);
- static void addToHost(const LLUUID& session_id, const bool force = false);
+ static LLIMFloater* getInstance(const LLUUID& session_id, LLConversationItemSession* session_root_model);
+ static void addToHost(const LLUUID& session_id, LLConversationItemSession* session_root_model, const bool force = false);
// LLFloater overrides
/*virtual*/ void onClose(bool app_quitting);
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index cf4d054dd5..75ccc56885 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -98,8 +98,8 @@ LLIMFloaterContainer::~LLIMFloaterContainer()
void LLIMFloaterContainer::sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id)
{
- LLIMFloater::addToHost(session_id, true);
- addConversationListItem(session_id, true);
+ LLConversationItemSession* item = addConversationListItem(session_id, true);
+ LLIMFloater::addToHost(session_id, item, true);
}
void LLIMFloaterContainer::sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id)
@@ -109,12 +109,13 @@ void LLIMFloaterContainer::sessionActivated(const LLUUID& session_id, const std:
void LLIMFloaterContainer::sessionVoiceOrIMStarted(const LLUUID& session_id)
{
- LLIMFloater::addToHost(session_id, true);
- addConversationListItem(session_id, true);
+ LLConversationItemSession* item = addConversationListItem(session_id, true);
+ LLIMFloater::addToHost(session_id, item, true);
}
void LLIMFloaterContainer::sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id)
{
+ // CHUI-441 : We should do this *without* delete and recreate
addConversationListItem(new_session_id, removeConversationListItem(old_session_id));
}
@@ -1167,11 +1168,11 @@ void LLIMFloaterContainer::setNearbyDistances()
}
}
-void LLIMFloaterContainer::addConversationListItem(const LLUUID& uuid, bool isWidgetSelected /*= false*/)
+LLConversationItemSession* LLIMFloaterContainer::addConversationListItem(const LLUUID& uuid, bool isWidgetSelected /*= false*/)
{
bool is_nearby_chat = uuid.isNull();
- //Stores the display name for the conversation line item
+ // Stores the display name for the conversation line item
std::string display_name = is_nearby_chat ? LLTrans::getString("NearbyChatLabel") : LLIMModel::instance().getName(uuid);
// Check if the item is not already in the list, exit if it is and has the same name and uuid (nothing to do)
@@ -1179,7 +1180,7 @@ void LLIMFloaterContainer::addConversationListItem(const LLUUID& uuid, bool isWi
conversations_items_map::iterator item_it = mConversationsItems.find(uuid);
if (item_it != mConversationsItems.end())
{
- return;
+ return item_it->second;
}
// Remove the conversation item that might exist already: it'll be recreated anew further down anyway
@@ -1196,7 +1197,7 @@ void LLIMFloaterContainer::addConversationListItem(const LLUUID& uuid, bool isWi
if (!item)
{
llwarns << "Couldn't create conversation session item : " << display_name << llendl;
- return;
+ return NULL;
}
item->renameItem(display_name);
item->updateParticipantName(NULL);
@@ -1234,7 +1235,7 @@ void LLIMFloaterContainer::addConversationListItem(const LLUUID& uuid, bool isWi
// scroll to newly added item
mConversationsRoot->scrollToShowSelection();
- return;
+ return item;
}
bool LLIMFloaterContainer::removeConversationListItem(const LLUUID& uuid, bool change_focus)
diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h
index ba2d085858..5823a47a8d 100644
--- a/indra/newview/llimfloatercontainer.h
+++ b/indra/newview/llimfloatercontainer.h
@@ -151,7 +151,7 @@ private:
// Conversation list implementation
public:
bool removeConversationListItem(const LLUUID& uuid, bool change_focus = true);
- void addConversationListItem(const LLUUID& uuid, bool isWidgetSelected = false);
+ LLConversationItemSession* addConversationListItem(const LLUUID& uuid, bool isWidgetSelected = false);
void setTimeNow(const LLUUID& session_id, const LLUUID& participant_id);
void setNearbyDistances();