diff options
author | Kyle Ambroff <ambroff@lindenlab.com> | 2010-11-15 14:14:00 -0800 |
---|---|---|
committer | Kyle Ambroff <ambroff@lindenlab.com> | 2010-11-15 14:14:00 -0800 |
commit | ed9af1151fea725574ddedafd75a9ecfb5927082 (patch) | |
tree | 6fb865d740e84865b439d224043a5de7151765c8 /indra/llmessage | |
parent | 0dbf75ab657446b51e6e9795ddccc16bb9f6fd02 (diff) | |
parent | a9eb639511a09dc072e67e10d8885a0b4f7587da (diff) |
Merge with lindenlab/viewer-development
Diffstat (limited to 'indra/llmessage')
-rw-r--r-- | indra/llmessage/llavatarnamecache.cpp | 14 | ||||
-rw-r--r-- | indra/llmessage/llcachename.cpp | 19 |
2 files changed, 16 insertions, 17 deletions
diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 2f2d9099a3..7396117d84 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -286,18 +286,8 @@ public: } // No information in header, make a guess - if (status == 503) - { - // ...service unavailable, retry soon - const F64 SERVICE_UNAVAILABLE_DELAY = 600.0; // 10 min - return now + SERVICE_UNAVAILABLE_DELAY; - } - else - { - // ...other unexpected error - const F64 DEFAULT_DELAY = 3600.0; // 1 hour - return now + DEFAULT_DELAY; - } + const F64 DEFAULT_DELAY = 120.0; // 2 mintues + return now + DEFAULT_DELAY; } }; diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 522b99bc02..4ab6bd2438 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -556,19 +556,28 @@ std::string LLCacheName::buildUsername(const std::string& full_name) //static std::string LLCacheName::buildLegacyName(const std::string& complete_name) { - boost::regex complete_name_regex("(.+)( \\()([A-Za-z]+)(.[A-Za-z]+)*(\\))"); + // regexp doesn't play nice with unicode, chop off the display name + S32 open_paren = complete_name.rfind(" ("); + + if (open_paren == std::string::npos) + { + return 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(complete_name, name_results, complete_name_regex)) return complete_name; + if (!boost::regex_match(username, name_results, complete_name_regex)) return complete_name; - std::string legacy_name = name_results[3]; + 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[4].matched) + if (name_results[3].matched) { - std::string last_name = name_results[4]; + 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); |