From 0a5ec5da9c52eeb0475414e67e4ac906c82d05cc Mon Sep 17 00:00:00 2001 From: James Cook Date: Thu, 27 May 2010 18:29:21 -0700 Subject: DEV-50013 Object returned to lost and found uses display names --- indra/newview/llviewermessage.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 6ead2e2457..704f4b4902 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2024,7 +2024,8 @@ static std::string clean_name_from_im(const std::string& name, EInstantMessage t } } -static std::string clean_name_from_task_im(const std::string& msg) +static std::string clean_name_from_task_im(const std::string& msg, + BOOL from_group) { boost::smatch match; static const boost::regex returned_exp( @@ -2034,7 +2035,20 @@ static std::string clean_name_from_task_im(const std::string& msg) // match objects are 1-based for groups std::string final = match[1].str(); std::string name = match[2].str(); - final += LLCacheName::cleanFullName(name); + // Don't try to clean up group names + if (!from_group) + { + if (LLAvatarNameCache::useDisplayNames()) + { + // ...just convert to username + final += LLCacheName::buildUsername(name); + } + else + { + // ...strip out legacy "Resident" name + final += LLCacheName::cleanFullName(name); + } + } final += match[3].str(); return final; } @@ -2593,7 +2607,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } // IDEVO Some messages have embedded resident names - message = clean_name_from_task_im(message); + message = clean_name_from_task_im(message, from_group); LLSD query_string; query_string["owner"] = from_id; -- cgit v1.2.3