diff options
author | James Cook <james@lindenlab.com> | 2010-02-17 09:19:06 -0800 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2010-02-17 09:19:06 -0800 |
commit | 5774acb84e486c1eabad88093e80e3985d36dfcb (patch) | |
tree | 6891e98f6563a718be3b478b7482fe5e17851fc7 /indra/llmessage | |
parent | e14a641619afc9948b590c2caf8df8df02bdbfe3 (diff) |
Added function LLCacheName::cleanFullName() to strip " Resident" from strings
Diffstat (limited to 'indra/llmessage')
-rw-r--r-- | indra/llmessage/llcachename.cpp | 6 | ||||
-rw-r--r-- | indra/llmessage/llcachename.h | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 0e8f9f4828..9ca0347f83 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -520,6 +520,12 @@ std::string LLCacheName::buildFullName(const std::string& first, const std::stri return fullname; } +//static +std::string LLCacheName::cleanFullName(const std::string& full_name) +{ + return full_name.substr(0, full_name.find(" Resident")); +} + // 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 diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h index 59ad03cfcc..083975d4ca 100644 --- a/indra/llmessage/llcachename.h +++ b/indra/llmessage/llcachename.h @@ -86,6 +86,10 @@ public: // IDEVO Temporary code // Clean up new-style "bobsmith123 Resident" names to "bobsmith123" for display static std::string buildFullName(const std::string& first, const std::string& last); + + // Clean up legacy "bobsmith123 Resident" to "bobsmith123" + // If name does not contain "Resident" returns it unchanged. + static std::string cleanFullName(const std::string& full_name); // If available, this method copies the group name into the string // provided. The caller must allocate at least |