From cc900f8b2c081a4a5ea363ee8bfb0cc9f6317bf6 Mon Sep 17 00:00:00 2001
From: Kelly Washington <kelly@lindenlab.com>
Date: Mon, 12 Nov 2012 14:12:27 -0800
Subject: [PATCH] MAINT-1897 Poor performance viewing large group member lists
 * llpanelgroupinvite to use LLAvatarNameCache isntead of legacy gCacheName

---
 indra/newview/llpanelgroupinvite.cpp | 11 ++++++-----
 indra/newview/llpanelgroupinvite.h   |  4 +++-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp
index 1ed8d8cf038..b9b347d4bea 100644
--- a/indra/newview/llpanelgroupinvite.cpp
+++ b/indra/newview/llpanelgroupinvite.cpp
@@ -467,10 +467,11 @@ void LLPanelGroupInvite::addUsers(uuid_vec_t& agent_ids)
 			//so we need to do this additional search in avatar tracker, see EXT-4732
 			if (LLAvatarTracker::instance().isBuddy(agent_id))
 			{
-				if (!gCacheName->getFullName(agent_id, fullname))
+				LLAvatarName av_name;
+				if (!LLAvatarNameCache::get(agent_id, &av_name))
 				{
 					// actually it should happen, just in case
-					gCacheName->get(LLUUID(agent_id), false, boost::bind(
+					LLAvatarNameCache::get(LLUUID(agent_id), boost::bind(
 							&LLPanelGroupInvite::addUserCallback, this, _1, _2));
 					// for this special case!
 					//when there is no cached name we should remove resident from agent_ids list to avoid breaking of sequence
@@ -479,7 +480,7 @@ void LLPanelGroupInvite::addUsers(uuid_vec_t& agent_ids)
 				}
 				else
 				{
-					names.push_back(fullname);
+					names.push_back(av_name.getLegacyName());
 				}
 			}
 		}
@@ -487,12 +488,12 @@ void LLPanelGroupInvite::addUsers(uuid_vec_t& agent_ids)
 	mImplementation->addUsers(names, agent_ids);
 }
 
-void LLPanelGroupInvite::addUserCallback(const LLUUID& id, const std::string& full_name)
+void LLPanelGroupInvite::addUserCallback(const LLUUID& id, const LLAvatarName& av_name)
 {
 	std::vector<std::string> names;
 	uuid_vec_t agent_ids;
 	agent_ids.push_back(id);
-	names.push_back(full_name);
+	names.push_back(av_name.getLegacyName());
 
 	mImplementation->addUsers(names, agent_ids);
 }
diff --git a/indra/newview/llpanelgroupinvite.h b/indra/newview/llpanelgroupinvite.h
index a7bfd2226e8..9f7b5ae9be1 100644
--- a/indra/newview/llpanelgroupinvite.h
+++ b/indra/newview/llpanelgroupinvite.h
@@ -29,6 +29,8 @@
 #include "llpanel.h"
 #include "lluuid.h"
 
+class LLAvatarName;
+
 class LLPanelGroupInvite
 : public LLPanel
 {
@@ -40,7 +42,7 @@ class LLPanelGroupInvite
 	/**
 	 * this callback is being used to add a user whose fullname isn't been loaded before invoking of addUsers().
 	 */  
-	void addUserCallback(const LLUUID& id, const std::string& full_name);
+	void addUserCallback(const LLUUID& id, const LLAvatarName& av_name);
 	void clear();
 	void update();
 
-- 
GitLab