summaryrefslogtreecommitdiff
path: root/indra/newview/llimconversation.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-10-29 16:59:53 -0700
committerMerov Linden <merov@lindenlab.com>2012-10-29 16:59:53 -0700
commit480c3a1acb32e98d0d64aaf7bb70e4d61e6882f6 (patch)
tree00e362ef88c2ac610c1a338bbfcb9992392fc91a /indra/newview/llimconversation.cpp
parent09282019ef4d068fe95a94931bf341d8e84f29ea (diff)
CHUI-469 : Fixed. Add the widget to its map, init the widget map consistently and correctly.
Diffstat (limited to 'indra/newview/llimconversation.cpp')
-rw-r--r--indra/newview/llimconversation.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp
index ad34acd941..f2421dd78f 100644
--- a/indra/newview/llimconversation.cpp
+++ b/indra/newview/llimconversation.cpp
@@ -50,6 +50,7 @@ LLIMConversation::LLIMConversation(const LLSD& session_id)
, mCloseBtn(NULL)
, mSessionID(session_id.asUUID())
// , mParticipantList(NULL)
+ , mConversationsRoot(NULL)
, mChatHistory(NULL)
, mInputEditor(NULL)
, mInputEditorTopPad(0)
@@ -309,6 +310,15 @@ void LLIMConversation::appendMessage(const LLChat& chat, const LLSD &args)
void LLIMConversation::buildConversationViewParticipant()
{
+ // Clear the widget list since we are rebuilding afresh from the model
+ conversations_widgets_map::iterator widget_it = mConversationsWidgets.begin();
+ while (widget_it != mConversationsWidgets.end())
+ {
+ removeConversationViewParticipant(widget_it->first);
+ // Iterators are invalidated by erase so we need to pick begin again
+ widget_it = mConversationsWidgets.begin();
+ }
+
// Get the model list
LLParticipantList* item = getParticipantList();
if (!item)
@@ -342,7 +352,7 @@ void LLIMConversation::addConversationViewParticipant(LLConversationItem* partic
else
{
LLConversationViewParticipant* participant_view = createConversationViewParticipant(participant_model);
- mConversationsWidgets[uuid] = widget;
+ mConversationsWidgets[uuid] = participant_view;
participant_view->addToFolder(mConversationsRoot);
participant_view->setVisible(TRUE);
refreshConversation();
@@ -373,10 +383,10 @@ void LLIMConversation::updateConversationViewParticipant(const LLUUID& participa
void LLIMConversation::refreshConversation()
{
- // *TODO: update the conversation name
- // *TODO: check that all participant models do have a view (this is a consistency check)
+ // *TODO: check that all participant models do have a view (debug consistency check)
mConversationViewModel.requestSortAll();
mConversationsRoot->arrangeAll();
+ mConversationsRoot->update();
}
// Copied from LLIMFloaterContainer::createConversationViewParticipant(). Refactor opportunity!
@@ -392,8 +402,6 @@ LLConversationViewParticipant* LLIMConversation::createConversationViewParticipa
params.tool_tip = params.name;
params.participant_id = item->getUUID();
- llinfos << "Merov debug : LLIMConversation, create participant, name = " << item->getDisplayName() << llendl;
-
return LLUICtrlFactory::create<LLConversationViewParticipant>(params);
}