diff options
| author | Eugene Mutavchi <emutavchi@productengine.com> | 2010-01-15 20:53:59 +0200 | 
|---|---|---|
| committer | Eugene Mutavchi <emutavchi@productengine.com> | 2010-01-15 20:53:59 +0200 | 
| commit | 49f246a4daca9cf4d2ddb3548dc2bf36d72991dd (patch) | |
| tree | c6f8d216313ff52c4351849a1c917e90f3edfef7 | |
| parent | c3c0b5ed47589b1074c42aff59cb33b97b62e0a1 (diff) | |
Fixed normal bug EXT-4211 (Viewer 2.0 IRC chat style works unlike 1.23)
--HG--
branch : product-engine
| -rw-r--r-- | indra/newview/llchatitemscontainerctrl.cpp | 37 | ||||
| -rw-r--r-- | indra/newview/llnearbychathandler.cpp | 10 | 
2 files changed, 24 insertions, 23 deletions
| diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index 9ce3f29853..f7f7ee83af 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -168,27 +168,30 @@ void LLNearbyChatToastPanel::init(LLSD& notification)  	msg_text->setText(std::string("")); -	std::string str_sender; -	 -	str_sender = fromName; +	if ( notification["chat_style"].asInteger() != CHAT_STYLE_IRC ) +	{ +		std::string str_sender; -	str_sender+=" "; +		str_sender = fromName; -	//append user name -	{ -		LLStyle::Params style_params_name; +		str_sender+=" "; -		LLColor4 userNameColor = LLUIColorTable::instance().getColor("ChatToastAgentNameColor"); +		//append user name +		{ +			LLStyle::Params style_params_name; -		style_params_name.color(userNameColor); -		 -		std::string font_name = LLFontGL::nameFromFont(messageFont); -		std::string font_style_size = LLFontGL::sizeFromFont(messageFont); -		style_params_name.font.name(font_name); -		style_params_name.font.size(font_style_size); -		 -		msg_text->appendText(str_sender, FALSE, style_params_name); -		 +			LLColor4 userNameColor = LLUIColorTable::instance().getColor("ChatToastAgentNameColor"); + +			style_params_name.color(userNameColor); + +			std::string font_name = LLFontGL::nameFromFont(messageFont); +			std::string font_style_size = LLFontGL::sizeFromFont(messageFont); +			style_params_name.font.name(font_name); +			style_params_name.font.size(font_style_size); + +			msg_text->appendText(str_sender, FALSE, style_params_name); + +		}  	}  	//append text diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 96442fafcc..c50e049d4c 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -180,11 +180,6 @@ void LLNearbyChatScreenChannel::addNotification(LLSD& notification)  		if(panel && panel->messageID() == fromID && panel->canAddText())  		{ -			if (CHAT_STYLE_IRC == notification["chat_style"].asInteger()) -			{ -				notification["message"] = notification["from"].asString() + notification["message"].asString(); -			} -  			panel->addMessage(notification);  			toast->reshapeToPanel();  			toast->resetTimer(); @@ -349,7 +344,10 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg)  	// Handle irc styled messages for toast panel  	if (tmp_chat.mChatStyle == CHAT_STYLE_IRC)  	{ -		tmp_chat.mText = tmp_chat.mText.substr(3); +		if(!tmp_chat.mFromName.empty()) +			tmp_chat.mText = tmp_chat.mFromName + tmp_chat.mText.substr(3); +		else +			tmp_chat.mText = tmp_chat.mText.substr(3);  	}  	// arrange a channel on a screen | 
