summaryrefslogtreecommitdiff
path: root/indra/newview/llconversationloglist.cpp
diff options
context:
space:
mode:
authorPaul ProductEngine <pguslisty@productengine.com>2012-09-11 17:45:49 +0300
committerPaul ProductEngine <pguslisty@productengine.com>2012-09-11 17:45:49 +0300
commit1e2dcbfb3fbc8717ea594365ff165115b29df83a (patch)
tree5f84d41dfa78d9eef7f9d258e92b95da9c47b22e /indra/newview/llconversationloglist.cpp
parent20b95f6ac0a63ce36cb1a7f51505bbf9ef8015c2 (diff)
CHUI-326 FIXED (One entry per conversation with a user in conversation log timestamped with most recent utterance/activity.)
- Modified LLConversationLog to show only one entry per conversation with user. I.e. there can't be two conversations with the same session_id in LLConversationLog. - Got rid of processing voice sessions - Refactored creation of conversation in LLConversationLog - Refactored a little bit LLConversation and LLConversationLog: function names and made some functions private
Diffstat (limited to 'indra/newview/llconversationloglist.cpp')
-rw-r--r--indra/newview/llconversationloglist.cpp57
1 files changed, 45 insertions, 12 deletions
diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp
index d39e090c22..429e99f7ad 100644
--- a/indra/newview/llconversationloglist.cpp
+++ b/indra/newview/llconversationloglist.cpp
@@ -143,22 +143,32 @@ void LLConversationLogList::changed()
void LLConversationLogList::changed(const LLUUID& session_id, U32 mask)
{
- if (mask & LLConversationLogObserver::VOICE_STATE)
+ LLConversationLogListItem* item = getConversationLogListItem(session_id);
+
+ if (!item)
{
- std::vector<LLPanel*> panels;
- LLFlatListViewEx::getItems(panels);
+ return;
+ }
- std::vector<LLPanel*>::iterator iter = panels.begin();
+ if (mask & LLConversationLogObserver::CHANGED_TIME)
+ {
+ item->updateTimestamp();
- for (; iter != panels.end(); ++iter)
+ // if list is sorted by date and a date of some item has changed,
+ // than the whole list should be rebuilt
+ if (E_SORT_BY_DATE == getSortOrder())
{
- LLConversationLogListItem* item = dynamic_cast<LLConversationLogListItem*>(*iter);
-
- if (item && session_id == item->getConversation()->getSessionID() && !item->getConversation()->isConversationPast())
- {
- item->initIcons();
- return;
- }
+ mIsDirty = true;
+ }
+ }
+ else if (mask & LLConversationLogObserver::CHANGED_NAME)
+ {
+ item->updateName();
+ // if list is sorted by name and a name of some item has changed,
+ // than the whole list should be rebuilt
+ if (E_SORT_BY_DATE == getSortOrder())
+ {
+ mIsDirty = true;
}
}
}
@@ -401,6 +411,29 @@ const LLConversation* LLConversationLogList::getSelectedConversation()
return NULL;
}
+LLConversationLogListItem* LLConversationLogList::getConversationLogListItem(const LLUUID& session_id)
+{
+ std::vector<LLPanel*> panels;
+ LLFlatListViewEx::getItems(panels);
+ std::vector<LLPanel*>::iterator iter = panels.begin();
+
+ for (; iter != panels.end(); ++iter)
+ {
+ LLConversationLogListItem* item = dynamic_cast<LLConversationLogListItem*>(*iter);
+ if (item && session_id == item->getConversation()->getSessionID())
+ {
+ return item;
+ }
+ }
+
+ return NULL;
+}
+
+LLConversationLogList::ESortOrder LLConversationLogList::getSortOrder()
+{
+ return static_cast<ESortOrder>(gSavedSettings.getU32("CallLogSortOrder"));
+}
+
bool LLConversationLogListItemComparator::compare(const LLPanel* item1, const LLPanel* item2) const
{
const LLConversationLogListItem* conversation_item1 = dynamic_cast<const LLConversationLogListItem*>(item1);