diff options
| author | Loren Shih <seraph@lindenlab.com> | 2010-12-01 10:55:24 -0500 | 
|---|---|---|
| committer | Loren Shih <seraph@lindenlab.com> | 2010-12-01 10:55:24 -0500 | 
| commit | bfd8efb05753ac9ed858476797b5d407c912d926 (patch) | |
| tree | 52905cf59bcd5b67ddc186b26a23959201353a7a /indra/llmessage | |
| parent | ed64630a67c2c216c369099532323cab2e251cab (diff) | |
| parent | b778ba9b882ecb03e61b3b9bd833618ca096f5da (diff) | |
Automated merge up from viewer-development
Diffstat (limited to 'indra/llmessage')
| -rw-r--r-- | indra/llmessage/llavatarnamecache.cpp | 14 | ||||
| -rw-r--r-- | indra/llmessage/llcachename.cpp | 66 | 
2 files changed, 37 insertions, 43 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 a8f53a38c3..caeaaa3be9 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -556,39 +556,43 @@ std::string LLCacheName::buildUsername(const std::string& full_name)  //static   std::string LLCacheName::buildLegacyName(const std::string& complete_name)  { -	// regexp doesn't play nice with unicode, chop off the display name +	//boost::regexp was showing up in the crashreporter, so doing   +	//painfully manual parsing using substr. LF  	S32 open_paren = complete_name.rfind(" ("); +	S32 close_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(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)
 -	{
 -		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";
 -	}
 -
 -	return legacy_name; +	if (open_paren != std::string::npos && +		close_paren == complete_name.length()-1) +	{ +		S32 length = close_paren - open_paren - 2; +		std::string legacy_name = complete_name.substr(open_paren+2, length); +		 +		if (legacy_name.length() > 0) +		{			 +			std::string cap_letter = legacy_name.substr(0, 1); +			LLStringUtil::toUpper(cap_letter); +			legacy_name = cap_letter + legacy_name.substr(1); +	 +			S32 separator = legacy_name.find('.'); + +			if (separator != std::string::npos) +			{ +				std::string last_name = legacy_name.substr(separator+1); +				legacy_name = legacy_name.substr(0, separator); + +				if (last_name.length() > 0) +				{ +					cap_letter = last_name.substr(0, 1); +					LLStringUtil::toUpper(cap_letter); +					legacy_name = legacy_name + " " + cap_letter + last_name.substr(1); +				} +			} + +			return legacy_name; +		} +	} + +	return complete_name;  }  // This is a little bit kludgy. LLCacheNameCallback is a slot instead of a function pointer. | 
