summaryrefslogtreecommitdiff
path: root/indra/newview/llconversationmodel.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-09-28 11:15:45 -0700
committerMerov Linden <merov@lindenlab.com>2012-09-28 11:15:45 -0700
commit0651e10afff81a6e32828c122753d87b8503a79b (patch)
tree3d0b9b8a42f45a3b120ef68b643509010736f84b /indra/newview/llconversationmodel.cpp
parent30ea13381884bca7a07e2bca16e5bde0ccacb530 (diff)
CHUI-342, CHUI-366 and CHUI-367 : WIP : Allow a NO_TOOLTIP value for tooltips, update display/user names and sort on display/user names
Diffstat (limited to 'indra/newview/llconversationmodel.cpp')
-rw-r--r--indra/newview/llconversationmodel.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp
index 7d0ffa0788..176c05248d 100644
--- a/indra/newview/llconversationmodel.cpp
+++ b/indra/newview/llconversationmodel.cpp
@@ -36,6 +36,7 @@
LLConversationItem::LLConversationItem(std::string display_name, const LLUUID& uuid, LLFolderViewModelInterface& root_view_model) :
LLFolderViewModelItemCommon(root_view_model),
mName(display_name),
+ mUseNameForSort(true),
mUUID(uuid),
mNeedsRefresh(true),
mConvType(CONV_UNKNOWN),
@@ -46,6 +47,7 @@ LLConversationItem::LLConversationItem(std::string display_name, const LLUUID& u
LLConversationItem::LLConversationItem(const LLUUID& uuid, LLFolderViewModelInterface& root_view_model) :
LLFolderViewModelItemCommon(root_view_model),
mName(""),
+ mUseNameForSort(true),
mUUID(uuid),
mNeedsRefresh(true),
mConvType(CONV_UNKNOWN),
@@ -56,6 +58,7 @@ LLConversationItem::LLConversationItem(const LLUUID& uuid, LLFolderViewModelInte
LLConversationItem::LLConversationItem(LLFolderViewModelInterface& root_view_model) :
LLFolderViewModelItemCommon(root_view_model),
mName(""),
+ mUseNameForSort(true),
mUUID(),
mNeedsRefresh(true),
mConvType(CONV_UNKNOWN),
@@ -251,8 +254,9 @@ LLConversationItemParticipant::LLConversationItemParticipant(const LLUUID& uuid,
void LLConversationItemParticipant::onAvatarNameCache(const LLAvatarName& av_name)
{
- mName = av_name.mUsername;
- mDisplayName = av_name.mDisplayName;
+ mUseNameForSort = !av_name.mUsername.empty();
+ mName = (mUseNameForSort ? av_name.mUsername : NO_TOOLTIP_STRING);
+ mDisplayName = (av_name.mDisplayName.empty() ? mName : av_name.mDisplayName);
mNeedsRefresh = true;
if (mParent)
{
@@ -363,7 +367,7 @@ bool LLConversationSort::operator()(const LLConversationItem* const& a, const LL
}
// By default, in all other possible cases (including sort order type LLConversationFilter::SO_NAME of course),
// we sort by name
- S32 compare = LLStringUtil::compareDict(a->getName(), b->getName());
+ S32 compare = LLStringUtil::compareDict((a->useNameForSort() ? a->getName() : a->getDisplayName()), (b->useNameForSort() ? b->getName() : b->getDisplayName()));
return (compare < 0);
}