Skip to content
Snippets Groups Projects
Commit 6cb420b2 authored by Leyla Farazha's avatar Leyla Farazha
Browse files

added function for building a username from a legacy name and fixed group notice panel

reviewed by James
parent c5c13a92
No related branches found
No related tags found
No related merge requests found
......@@ -527,6 +527,30 @@ std::string LLCacheName::cleanFullName(const std::string& full_name)
return full_name.substr(0, full_name.find(" Resident"));
}
//static
std::string LLCacheName::buildUsername(const std::string& full_name)
{
std::string::size_type index = full_name.find(' ');
if (index != std::string::npos)
{
std::string username;
username = full_name.substr(0, index);
std::string lastname = full_name.substr(index+1);
if (lastname != "Resident")
{
username = username + "." + lastname;
}
LLStringUtil::toLower(username);
return username;
}
// if the input wasn't a correctly formatted legacy name just return it unchanged
return full_name;
}
// This is a little bit kludgy. LLCacheNameCallback is a slot instead of a function pointer.
// The reason it is a slot is so that the legacy get() function below can bind an old callback
// and pass it as a slot. The reason it isn't a boost::function is so that trackable behavior
......
......@@ -91,6 +91,11 @@ class LLCacheName
// If name does not contain "Resident" returns it unchanged.
static std::string cleanFullName(const std::string& full_name);
// Converts a standard legacy name to a username
// "bobsmith123 Resident" -> "bobsmith"
// "Random Linden" -> "random.linden"
static std::string buildUsername(const std::string& name);
// If available, this method copies the group name into the string
// provided. The caller must allocate at least
// DB_GROUP_NAME_BUF_SIZE characters. If not available, this
......
......@@ -548,8 +548,8 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
msg->getU8("Data","AssetType",asset_type,i);
msg->getU32("Data","Timestamp",timestamp,i);
// IDEVO clean up legacy "Resident" names
name = LLCacheName::cleanFullName(name);
// we only have the legacy name here, convert it to a username
name = LLCacheName::buildUsername(name);
LLSD row;
row["id"] = id;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment