diff options
author | Leyla Farazha <leyla@lindenlab.com> | 2010-11-04 11:51:45 -0700 |
---|---|---|
committer | Leyla Farazha <leyla@lindenlab.com> | 2010-11-04 11:51:45 -0700 |
commit | dfdd1abe513facad78f8169405879a05d6e8d56b (patch) | |
tree | a4ce6901676783809efa2a73aad22b98872b66ec /indra/llmessage/llcachename.cpp | |
parent | 25c5f8aeb338803ce5a1386595877d15e6ce0aed (diff) |
DN-188 Fixed users with lastname residents not having inspectors in chat history
Diffstat (limited to 'indra/llmessage/llcachename.cpp')
-rw-r--r-- | indra/llmessage/llcachename.cpp | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index a8f53a38c3..4ab6bd2438 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -565,29 +565,25 @@ std::string LLCacheName::buildLegacyName(const std::string& complete_name) } std::string username = complete_name.substr(open_paren); - boost::regex complete_name_regex("( \\()([a-z0-9]+)(.[a-z]+)*(\\))");
- boost::match_results<std::string::const_iterator> name_results;
- if (!boost::regex_match(username, name_results, complete_name_regex)) return complete_name;
-
+ boost::regex complete_name_regex("( \\()([a-z0-9]+)(.[a-z]+)*(\\))"); + boost::match_results<std::string::const_iterator> name_results; + if (!boost::regex_match(username, name_results, complete_name_regex)) return complete_name; + std::string legacy_name = name_results[2]; // capitalize the first letter std::string cap_letter = legacy_name.substr(0, 1); LLStringUtil::toUpper(cap_letter); - legacy_name = cap_letter + legacy_name.substr(1);
-
- if (name_results[3].matched)
- {
+ legacy_name = cap_letter + legacy_name.substr(1); + + if (name_results[3].matched) + { std::string last_name = name_results[3]; std::string cap_letter = last_name.substr(1, 1); LLStringUtil::toUpper(cap_letter); - last_name = cap_letter + last_name.substr(2);
- legacy_name = legacy_name + " " + last_name;
- }
- else
- {
- legacy_name = legacy_name + " Resident";
- }
-
+ last_name = cap_letter + last_name.substr(2); + legacy_name = legacy_name + " " + last_name; + } + return legacy_name; } |