Feature Request: Add an option to keep last name Resident.

Should work to solve Issue 517: Legacy log handling of "Resident" name
This commit is contained in:
Lirusaito
2013-07-19 07:16:51 -04:00
parent aaf010da4c
commit 863c35710f
4 changed files with 24 additions and 3 deletions

View File

@@ -29,6 +29,7 @@
#include "llcachename.h"
// linden library includes
#include "llcontrol.h" // For LLCachedControl
#include "lldbstrings.h"
#include "llframetimer.h"
#include "llhost.h"
@@ -506,9 +507,10 @@ BOOL LLCacheName::getUUID(const std::string& full_name, LLUUID& id)
//static
std::string LLCacheName::buildFullName(const std::string& first, const std::string& last)
{
static const LLCachedControl<bool> show_resident("LiruShowLastNameResident", false);
std::string fullname = first;
if (!last.empty()
&& last != "Resident")
&& (show_resident || last != "Resident"))
{
fullname += ' ';
fullname += last;
@@ -519,6 +521,8 @@ std::string LLCacheName::buildFullName(const std::string& first, const std::stri
//static
std::string LLCacheName::cleanFullName(const std::string& full_name)
{
static const LLCachedControl<bool> show_resident("LiruShowLastNameResident", false);
if (show_resident) return full_name;
return full_name.substr(0, full_name.find(" Resident"));
}
@@ -539,7 +543,8 @@ std::string LLCacheName::buildUsername(const std::string& full_name)
username = full_name.substr(0, index);
std::string lastname = full_name.substr(index+1);
if (lastname != "Resident")
static const LLCachedControl<bool> show_resident("LiruShowLastNameResident", false);
if (lastname != "Resident" || show_resident)
{
username = username + "." + lastname;
}