diff options
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/llmessage/llcachename.cpp | 39 | ||||
| -rw-r--r-- | indra/newview/llhints.cpp | 9 | ||||
| -rw-r--r-- | indra/newview/llimview.cpp | 20 | ||||
| -rw-r--r-- | indra/newview/llimview.h | 2 | ||||
| -rw-r--r-- | indra/newview/llvoavatar.h | 5 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/floater_display_name.xml | 2 | 
6 files changed, 49 insertions, 28 deletions
| diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 522b99bc02..a8f53a38c3 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -556,25 +556,38 @@ 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]+)*(\\))"); -	boost::match_results<std::string::const_iterator> name_results; -	if (!boost::regex_match(complete_name, name_results, complete_name_regex)) return complete_name; +	// regexp doesn't play nice with unicode, chop off the display name +	S32 open_paren = complete_name.rfind(" ("); -	std::string legacy_name = name_results[3]; +	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[4].matched) -	{ -		std::string last_name = name_results[4]; +	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; -	} - +		last_name = cap_letter + last_name.substr(2);
 +		legacy_name = legacy_name + " " + last_name;
 +	}
 +	else
 +	{
 +		legacy_name = legacy_name + " Resident";
 +	}
 +
  	return legacy_name;  } diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index 7f6df627e0..3f0deb98cd 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -109,7 +109,14 @@ public:  	/*virtual*/ BOOL postBuild(); -	void onClickClose() { hide(); LLNotifications::instance().cancel(mNotification); } +	void onClickClose()  +	{  +		if (!mHidden)  +		{ +			hide();  +			LLNotifications::instance().cancel(mNotification); +		} +	}  	void draw();  	void hide() { if(!mHidden) {mHidden = true; mFadeTimer.reset();} } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 914e7a3df0..164c51a9e0 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -257,21 +257,17 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string&  	// history files have consistent (English) names in different locales.  	if (isAdHocSessionType() && IM_SESSION_INVITE == type)  	{ -		// Name here has a form of "<Avatar's name> Conference" -		// Lets update it to localize the "Conference" word. See EXT-8429. -		S32 separator_index = mName.rfind(" "); -		std::string name = mName.substr(0, separator_index); -		++separator_index; -		std::string conference_word = mName.substr(separator_index, mName.length()); +		LLAvatarNameCache::get(mOtherParticipantID,  +							   boost::bind(&LLIMModel::LLIMSession::onAdHocNameCache,  +							   this, _2)); +	} +} -		// additional check that session name is what we expected -		if ("Conference" == conference_word) -		{ +void LLIMModel::LLIMSession::onAdHocNameCache(const LLAvatarName& av_name) +{  			LLStringUtil::format_map_t args; -			args["[AGENT_NAME]"] = name; +	args["[AGENT_NAME]"] = av_name.getCompleteName();  			LLTrans::findString(mName, "conference-title-incoming", args); -		} -	}  }  void LLIMModel::LLIMSession::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state, const LLVoiceChannel::EDirection& direction) diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 3da4465862..650d329e18 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -100,6 +100,8 @@ public:  		void onAvatarNameCache(const LLUUID& avatar_id, const LLAvatarName& av_name); +		void onAdHocNameCache(const LLAvatarName& av_name);
 +  		//*TODO make private  		static std::string generateHash(const std::set<LLUUID>& sorted_uuids); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index f4f1235d55..a779a1735c 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -33,6 +33,8 @@  #include <string>  #include <vector> +#include <boost/signals2.hpp> +  #include "imageids.h"			// IMG_INVISIBLE  #include "llchat.h"  #include "lldrawpoolalpha.h" @@ -71,7 +73,8 @@ class LLVOAvatarSkeletonInfo;  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  class LLVOAvatar :  	public LLViewerObject, -	public LLCharacter +	public LLCharacter, +	public boost::signals2::trackable  {  public:  	friend class LLVOAvatarSelf; diff --git a/indra/newview/skins/default/xui/en/floater_display_name.xml b/indra/newview/skins/default/xui/en/floater_display_name.xml index 7a3fb9334a..9a9fd32a77 100644 --- a/indra/newview/skins/default/xui/en/floater_display_name.xml +++ b/indra/newview/skins/default/xui/en/floater_display_name.xml @@ -63,7 +63,7 @@         width="300"         height="20"        font="SansSerif" -    name="set_name_label"> +    name="name_confirm_label">        Type your new name again to confirm:      </text>      <line_editor | 
