From 08cc82ec483fab8299d52ba979f04df95e525acb Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Thu, 13 Dec 2012 22:45:47 -0800
Subject: [PATCH] CHUI-599 : Fixed : Avatar name provides now a method to get
 the regular account name.

---
 indra/llcommon/llavatarname.h     | 3 +++
 indra/newview/llavataractions.cpp | 8 ++------
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h
index 2f8c534974b..4827353018e 100644
--- a/indra/llcommon/llavatarname.h
+++ b/indra/llcommon/llavatarname.h
@@ -74,6 +74,9 @@ class LL_COMMON_API LLAvatarName
 	// Also used for backwards compatibility with systems like voice and muting
 	std::string getUserName() const;
 	
+	// Returns "james.linden" or the legacy name for very old names
+	std::string getAccountName() const { return mUsername; }
+
 	// Debug print of the object
 	void dump() const;
 	
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 59b862503c9..23d528901a3 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -315,15 +315,11 @@ static const char* get_profile_floater_name(const LLUUID& avatar_id)
 
 static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarName& av_name)
 {
-	std::string username = av_name.getUserName();
-	
-	llinfos << "opening web profile for " << username << llendl;		
-	std::string url = getProfileURL(username);
+	std::string url = getProfileURL(av_name.getAccountName());
 
 	// PROFILES: open in webkit window
 	LLFloaterWebContent::Params p;
-	p.url(url).
-		id(agent_id.asString());
+	p.url(url).id(agent_id.asString());
 	LLFloaterReg::showInstance(get_profile_floater_name(agent_id), p);
 }
 
-- 
GitLab