From 2af4875309450fa3d3e266426ada12330489a8c9 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Thu, 13 May 2010 17:26:06 -0700 Subject: DEV-50013 Friends in sidebar now correctly displaying names reviewed by James --- indra/newview/llavatarlist.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'indra/newview/llavatarlist.cpp') diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index dfb213716c..8801903df7 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -41,6 +41,7 @@ // newview #include "llavatariconctrl.h" +#include "llavatarnamecache.h" #include "llcallingcard.h" // for LLAvatarTracker #include "llcachename.h" #include "llrecentpeople.h" @@ -239,12 +240,15 @@ void LLAvatarList::refresh() // Handle added items. unsigned nadded = 0; + const std::string waiting_str = LLTrans::getString("AvatarNameWaiting"); + for (uuid_vec_t::const_iterator it=added.begin(); it != added.end(); it++) { - std::string name; const LLUUID& buddy_id = *it; - have_names &= (bool)gCacheName->getFullName(buddy_id, name); - if (!have_filter || findInsensitive(name, mNameFilter)) + LLAvatarName av_name; + have_names &= LLAvatarNameCache::get(buddy_id, &av_name); + + if (!have_filter || findInsensitive(av_name.mDisplayName, mNameFilter)) { if (nadded >= ADD_LIMIT) { @@ -253,7 +257,9 @@ void LLAvatarList::refresh() } else { - addNewItem(buddy_id, name, LLAvatarTracker::instance().isBuddyOnline(buddy_id)); + addNewItem(buddy_id, + av_name.mDisplayName.empty() ? waiting_str : av_name.mDisplayName, + LLAvatarTracker::instance().isBuddyOnline(buddy_id)); modified = true; nadded++; } -- cgit v1.2.3 From b2274765dade87417f5b526c8b72f353ba6f4898 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 25 May 2010 14:48:55 -0700 Subject: DEV-50013 Group chat moderator tooltip shows username --- indra/newview/llavatarlist.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview/llavatarlist.cpp') diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 0c4a51d7fe..9258ad0256 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -379,7 +379,7 @@ S32 LLAvatarList::notifyParent(const LLSD& info) void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) { LLAvatarListItem* item = new LLAvatarListItem(); - item->setName(name); + // This sets the name as a side effect item->setAvatarId(id, mSessionID, mIgnoreOnlineStatus); item->setOnline(mIgnoreOnlineStatus ? true : is_online); item->showLastInteractionTime(mShowLastInteractionTime); @@ -545,11 +545,13 @@ void LLAvalineListItem::setName(const std::string& name) std::string hidden_name = LLTrans::getString("AvalineCaller", args); LL_DEBUGS("Avaline") << "Avaline caller: " << uuid << ", name: " << hidden_name << LL_ENDL; - LLAvatarListItem::setName(hidden_name); + LLAvatarListItem::setAvatarName(hidden_name); + LLAvatarListItem::setAvatarToolTip(hidden_name); } else { const std::string& formatted_phone = LLTextUtil::formatPhoneNumber(name); - LLAvatarListItem::setName(formatted_phone); + LLAvatarListItem::setAvatarName(formatted_phone); + LLAvatarListItem::setAvatarToolTip(formatted_phone); } } -- cgit v1.2.3 From 3bbb622731b2a6a29fc6576dcf4885527d813699 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 28 May 2010 08:21:33 -0700 Subject: WIP Fix miscellaneous display names in UI --- indra/newview/llavatarlist.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'indra/newview/llavatarlist.cpp') diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 57624dec8b..c35e71cc71 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -260,6 +260,8 @@ void LLAvatarList::refresh() } else { + // *NOTE: If you change the UI to show a different string, + // be sure to change the filter code below. addNewItem(buddy_id, av_name.mDisplayName.empty() ? waiting_str : av_name.mDisplayName, LLAvatarTracker::instance().isBuddyOnline(buddy_id)); @@ -284,10 +286,10 @@ void LLAvatarList::refresh() for (std::vector::const_iterator it=cur_values.begin(); it != cur_values.end(); it++) { - std::string name; const LLUUID& buddy_id = it->asUUID(); - have_names &= (bool)gCacheName->getFullName(buddy_id, name); - if (!findInsensitive(name, mNameFilter)) + LLAvatarName av_name; + have_names &= LLAvatarNameCache::get(buddy_id, &av_name); + if (!findInsensitive(av_name.mDisplayName, mNameFilter)) { removeItemByUUID(buddy_id); modified = true; @@ -339,14 +341,14 @@ bool LLAvatarList::filterHasMatches() for (uuid_vec_t::const_iterator it=values.begin(); it != values.end(); it++) { - std::string name; const LLUUID& buddy_id = *it; - BOOL have_name = gCacheName->getFullName(buddy_id, name); + LLAvatarName av_name; + bool have_name = LLAvatarNameCache::get(buddy_id, &av_name); // If name has not been loaded yet we consider it as a match. // When the name will be loaded the filter will be applied again(in refresh()). - if (have_name && !findInsensitive(name, mNameFilter)) + if (have_name && !findInsensitive(av_name.mDisplayName, mNameFilter)) { continue; } -- cgit v1.2.3