summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llconversationmodel.h2
-rw-r--r--indra/newview/llfloaterimcontainer.cpp22
-rw-r--r--indra/newview/llfloaterimcontainer.h2
3 files changed, 20 insertions, 6 deletions
diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h
index 7c6980a7e6..457b2e83fb 100644
--- a/indra/newview/llconversationmodel.h
+++ b/indra/newview/llconversationmodel.h
@@ -40,7 +40,7 @@ class LLConversationItem;
class LLConversationItemSession;
class LLConversationItemParticipant;
-typedef std::map<LLUUID, LLConversationItem*> conversations_items_map;
+typedef std::map<LLUUID, LLPointer<LLConversationItem> > conversations_items_map;
typedef std::map<LLUUID, LLFolderViewItem*> conversations_widgets_map;
typedef std::vector<std::string> menuentry_vec_t;
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 2720b7fcf7..172e672dc5 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -155,6 +155,20 @@ void LLFloaterIMContainer::sessionIDUpdated(const LLUUID& old_session_id, const
LLFloaterIMSessionTab::addToHost(new_session_id);
}
+
+LLConversationItem* LLFloaterIMContainer::getSessionModel(const LLUUID& session_id)
+{
+ conversations_items_map::iterator iter = mConversationsItems.find(session_id);
+ if (iter == mConversationsItems.end())
+ {
+ return NULL;
+ }
+ else
+ {
+ return iter->second.get();
+ }
+}
+
void LLFloaterIMContainer::sessionRemoved(const LLUUID& session_id)
{
removeConversationListItem(session_id);
@@ -608,7 +622,8 @@ void LLFloaterIMContainer::handleConversationModelEvent(const LLSD& event)
}
else if (type == "add_participant")
{
- LLConversationItemSession* session_model = dynamic_cast<LLConversationItemSession*>(mConversationsItems[session_id]);
+ LLConversationItem* item = getSessionModel(session_id);
+ LLConversationItemSession* session_model = dynamic_cast<LLConversationItemSession*>(item);
LLConversationItemParticipant* participant_model = (session_model ? session_model->findParticipant(participant_id) : NULL);
LLIMModel::LLIMSession * im_sessionp = LLIMModel::getInstance()->findIMSession(session_id);
if (!participant_view && session_model && participant_model)
@@ -1749,10 +1764,9 @@ BOOL LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool
void LLFloaterIMContainer::setTimeNow(const LLUUID& session_id, const LLUUID& participant_id)
{
- LLConversationItemSession* item = dynamic_cast<LLConversationItemSession*>(get_ptr_in_map(mConversationsItems,session_id));
+ LLConversationItemSession* item = dynamic_cast<LLConversationItemSession*>(getSessionModel(session_id));
if (item)
{
- item->setTimeNow(participant_id);
mConversationViewModel.requestSortAll();
mConversationsRoot->arrangeAll();
}
@@ -1761,7 +1775,7 @@ void LLFloaterIMContainer::setTimeNow(const LLUUID& session_id, const LLUUID& pa
void LLFloaterIMContainer::setNearbyDistances()
{
// Get the nearby chat session: that's the one with uuid nul
- LLConversationItemSession* item = dynamic_cast<LLConversationItemSession*>(get_ptr_in_map(mConversationsItems,LLUUID()));
+ LLConversationItemSession* item = dynamic_cast<LLConversationItemSession*>(getSessionModel(LLUUID()));
if (item)
{
// Get the positions of the nearby avatars and their ids
diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h
index b4a9d377ab..82f3b00ebc 100644
--- a/indra/newview/llfloaterimcontainer.h
+++ b/indra/newview/llfloaterimcontainer.h
@@ -106,7 +106,7 @@ public:
LLConversationViewModel& getRootViewModel() { return mConversationViewModel; }
LLUUID getSelectedSession() { return mSelectedSession; }
void setSelectedSession(LLUUID sessionID) { mSelectedSession = sessionID; }
- LLConversationItem* getSessionModel(const LLUUID& session_id) { return get_ptr_in_map(mConversationsItems,session_id); }
+ LLConversationItem* getSessionModel(const LLUUID& session_id);
LLConversationSort& getSortOrder() { return mConversationViewModel.getSorter(); }
// Handling of lists of participants is public so to be common with llfloatersessiontab