summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llconversationview.cpp13
-rw-r--r--indra/newview/llimconversation.cpp11
-rw-r--r--indra/newview/llimconversation.h2
-rw-r--r--indra/newview/llimfloatercontainer.cpp29
4 files changed, 32 insertions, 23 deletions
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index 9144f402b4..2d5665190f 100755
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -234,9 +234,9 @@ void LLConversationViewSession::toggleOpen()
void LLConversationViewSession::selectItem()
{
-
- LLConversationItem* item = dynamic_cast<LLConversationItem*>(mViewModelItem);
- LLFloater* session_floater = LLIMConversation::getConversation(item->getUUID());
+ LLFolderViewModelItem* item = mViewModelItem;
+ LLUUID session_uuid = dynamic_cast<LLConversationItem*>(item)->getUUID();
+ LLFloater* session_floater = LLIMConversation::getConversation(session_uuid);
LLMultiFloater* host_floater = session_floater->getHost();
if (host_floater == mContainer)
@@ -250,7 +250,7 @@ void LLConversationViewSession::selectItem()
// Set the focus on the selected floater
session_floater->setFocus(TRUE);
// Store the active session
- LLIMFloaterContainer::getInstance()->setSelectedSession(item->getUUID());
+ LLIMFloaterContainer::getInstance()->setSelectedSession(session_uuid);
LLFolderViewItem::selectItem();
@@ -272,8 +272,9 @@ void LLConversationViewSession::setVisibleIfDetached(BOOL visible)
{
// Do this only if the conversation floater has been torn off (i.e. no multi floater host) and is not minimized
// Note: minimized dockable floaters are brought to front hence unminimized when made visible and we don't want that here
- LLConversationItem* item = dynamic_cast<LLConversationItem*>(mViewModelItem);
- LLFloater* session_floater = LLIMConversation::getConversation(item->getUUID());
+ LLFolderViewModelItem* item = mViewModelItem;
+ LLUUID session_uuid = dynamic_cast<LLConversationItem*>(item)->getUUID();
+ LLFloater* session_floater = LLIMConversation::getConversation(session_uuid);
if (session_floater && !session_floater->getHost() && !session_floater->isMinimized())
{
diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp
index 1e268bcaf9..532f1be6a8 100644
--- a/indra/newview/llimconversation.cpp
+++ b/indra/newview/llimconversation.cpp
@@ -351,6 +351,17 @@ void LLIMConversation::buildParticipantList()
//updateHeaderAndToolbar();
}
+void LLIMConversation::addConversationViewParticipant(LLConversationItem* participant_model)
+{
+ // Check if the model already has an associated view
+ llinfos << "Merov debug : addConversationViewParticipant(). We need to check the existence!!!" << llendl;
+
+ // Create the participant view and attach it to the root
+ LLConversationViewParticipant* participant_view = createConversationViewParticipant(participant_model);
+ participant_view->addToFolder(mConversationsRoot); // ! Not sure about that. TBC...
+ participant_view->setVisible(TRUE);
+}
+
// Copied from LLIMFloaterContainer::createConversationViewParticipant(). Refactor opportunity!
LLConversationViewParticipant* LLIMConversation::createConversationViewParticipant(LLConversationItem* item)
{
diff --git a/indra/newview/llimconversation.h b/indra/newview/llimconversation.h
index c3f885c8be..09d0016946 100644
--- a/indra/newview/llimconversation.h
+++ b/indra/newview/llimconversation.h
@@ -71,6 +71,8 @@ public:
/*virtual*/ void onClose(bool app_quitting);
/*virtual*/ BOOL postBuild();
/*virtual*/ void draw();
+
+ void addConversationViewParticipant(LLConversationItem* item);
protected:
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index 11d8b29884..0d62630b31 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -98,9 +98,7 @@ LLIMFloaterContainer::~LLIMFloaterContainer()
void LLIMFloaterContainer::sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id)
{
- llinfos << "Merov debug : sessionAdded, adding conversation item, id = " << session_id << llendl;
addConversationListItem(session_id, true);
- llinfos << "Merov debug : sessionAdded, adding LLIMFloater, id = " << session_id << llendl;
LLIMFloater::addToHost(session_id, true);
}
@@ -111,9 +109,7 @@ void LLIMFloaterContainer::sessionActivated(const LLUUID& session_id, const std:
void LLIMFloaterContainer::sessionVoiceOrIMStarted(const LLUUID& session_id)
{
- llinfos << "Merov debug : sessionVoiceOrIMStarted, adding conversation item, id = " << session_id << llendl;
addConversationListItem(session_id, true);
- llinfos << "Merov debug : sessionVoiceOrIMStarted, adding LLIMFloater, id = " << session_id << llendl;
LLIMFloater::addToHost(session_id, true);
}
@@ -433,6 +429,7 @@ bool LLIMFloaterContainer::onConversationModelEvent(const LLSD& event)
return false;
}
LLConversationViewParticipant* participant_view = session_view->findParticipant(participant_id);
+ LLIMFloater *conversation_floater = LLIMFloater::findInstance(session_id);
if (type == "remove_participant")
{
@@ -446,20 +443,18 @@ bool LLIMFloaterContainer::onConversationModelEvent(const LLSD& event)
}
else if (type == "add_participant")
{
- if (!participant_view)
+ LLConversationItemSession* session_model = dynamic_cast<LLConversationItemSession*>(get_ptr_in_map(mConversationsItems,session_id));
+ LLConversationItemParticipant* participant_model = (session_model ? session_model->findParticipant(participant_id) : NULL);
+ if (!participant_view && session_model && participant_model)
{
- LLConversationItemSession* session_model = dynamic_cast<LLConversationItemSession*>(get_ptr_in_map(mConversationsItems,session_id));
- if (session_model)
- {
- LLConversationItemParticipant* participant_model = session_model->findParticipant(participant_id);
- if (participant_model)
- {
- participant_view = createConversationViewParticipant(participant_model);
- participant_view->addToFolder(session_view);
- participant_view->setVisible(TRUE);
- }
- }
-
+ participant_view = createConversationViewParticipant(participant_model);
+ participant_view->addToFolder(session_view);
+ participant_view->setVisible(TRUE);
+ }
+ // CHUI-441 :
+ if (conversation_floater && participant_model)
+ {
+ conversation_floater->addConversationViewParticipant(participant_model);
}
}
else if (type == "update_participant")