diff --git a/indra/llui/llstyle.cpp b/indra/llui/llstyle.cpp
index 71511f69a41307099f4d88c505c98c7b59c11d34..92c0b7c1b46663453c02c74f9d04f19a415e7900 100644
--- a/indra/llui/llstyle.cpp
+++ b/indra/llui/llstyle.cpp
@@ -44,7 +44,10 @@ LLStyle::Params::Params()
 	color("color", LLColor4::black),
 	font("font", LLFontGL::getFontMonospace()),
 	image("image"),
-	link_href("href")
+	link_href("href"),
+	italic("italic", false ),
+	bold("bold", false),
+    underline("bold", false)
 {}
 
 
@@ -55,7 +58,10 @@ LLStyle::LLStyle(const LLStyle::Params& p)
 	mFont(p.font()),
 	mLink(p.link_href),
 	mDropShadow(p.drop_shadow),
-	mImagep(p.image())
+	mImagep(p.image()),
+	mItalic(p.italic()),
+	mBold(p.bold),
+	mUnderline(p.underline)
 {}
 
 void LLStyle::setFont(const LLFontGL* font)
@@ -69,6 +75,25 @@ const LLFontGL* LLStyle::getFont() const
 	return mFont;
 }
 
+const S32 LLStyle::getFontStyle() const
+{
+	S32 ret = 0;
+	if (mBold)
+	{
+		ret |= LLFontGL::BOLD;
+	}
+	if (mItalic)
+	{
+		ret |= LLFontGL::ITALIC;
+	}
+	if (mUnderline)
+	{
+		ret |= LLFontGL::UNDERLINE;
+	}
+	return ret;
+}
+
+
 void LLStyle::setLinkHREF(const std::string& href)
 {
 	mLink = href;
diff --git a/indra/llui/llstyle.h b/indra/llui/llstyle.h
index ee9ca730e9473820e537e76d6a3ff331a1487e93..cc72011903c52f4afbddf7b47d69224e6e6c73b3 100644
--- a/indra/llui/llstyle.h
+++ b/indra/llui/llstyle.h
@@ -51,12 +51,17 @@ class LLStyle : public LLRefCount
 		Optional<const LLFontGL*>		font;
 		Optional<LLUIImage*>			image;
 		Optional<std::string>			link_href;
+		Optional<bool>					italic;
+		Optional<bool>					bold;
+		Optional<bool>					underline;
 		Params();
 	};
 	LLStyle(const Params& p = Params());
 public:
 	const LLColor4& getColor() const { return mColor; }
 	void setColor(const LLColor4 &color) { mColor = color; }
+	
+	const S32 getFontStyle() const;
 
 	const LLColor4& getReadOnlyColor() const { return mReadOnlyColor; }
 
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 7b1aaac35cbc42e1986a50e61d4782259524eeb5..d7697ac7cc715441b9c2de18dceeafdd4de3a04a 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1506,9 +1506,8 @@ void LLTextBase::appendText(const std::string &new_text, bool prepend_newline, c
 			LLStyle::Params link_params = style_params;
 			link_params.color = match.getColor();
 			// apply font name from requested style_params
-			std::string font_name = LLFontGL::nameFromFont(style_params.font());
-			link_params.font.name.setIfNotProvided(font_name);
-			link_params.font.style = "UNDERLINE";
+			std::string font_name = LLFontGL::nameFromFont(style_params.font());			
+			link_params.underline = true;
 			link_params.link_href = match.getUrl();
 
 			// output the text before the Url
@@ -2251,7 +2250,7 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele
 					rect.mLeft, rect.mTop, 
 					color, 
 					LLFontGL::LEFT, LLFontGL::TOP, 
-					0, 
+					mStyle->getFontStyle(), 
 					mStyle->getShadowType(), 
 					length, rect.getWidth(), 
 					&right_x, 
@@ -2270,7 +2269,7 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele
 					rect.mLeft, rect.mTop,
 					LLColor4( 1.f - color.mV[0], 1.f - color.mV[1], 1.f - color.mV[2], 1.f ),
 					LLFontGL::LEFT, LLFontGL::TOP, 
-					0, 
+					mStyle->getFontStyle(), 
 					LLFontGL::NO_SHADOW, 
 					length, rect.mRight, 
 					&right_x, 
@@ -2287,7 +2286,7 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele
 					rect.mLeft, rect.mTop, 
 					color, 
 					LLFontGL::LEFT, LLFontGL::TOP, 
-					0, 
+					mStyle->getFontStyle(), 
 					mStyle->getShadowType(), 
 					length, rect.mRight, 
 					&right_x, 
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index 028bb7a384870427e7de8486ffbcd32ca6ae2e8f..bec8eb2666593777c7be670f9df69636dac9d878 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -345,7 +345,7 @@ LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style
 	return header;
 }
 
-void LLChatHistory::appendWidgetMessage(const LLChat& chat)
+void LLChatHistory::appendWidgetMessage(const LLChat& chat, const LLStyle::Params& input_append_params)
 {
 	LLView* view = NULL;
 	std::string view_text = "\n[" + formatCurrentTime() + "] ";
@@ -367,7 +367,9 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat)
 	style_params.color(txt_color);
 	style_params.readonly_color(txt_color);
 	style_params.font(fontp);
-
+	style_params.italic = input_append_params.italic;
+	style_params.underline = input_append_params.underline;
+	style_params.bold = input_append_params.bold;
 	
 	if (mLastFromName == chat.mFromName)
 	{
diff --git a/indra/newview/llchathistory.h b/indra/newview/llchathistory.h
index f689a225fe334ca4dc09f6e17a94593495982926..c89d4b4ec67a877ca7dc5800ba71ef95985b788c 100644
--- a/indra/newview/llchathistory.h
+++ b/indra/newview/llchathistory.h
@@ -109,7 +109,7 @@ class LLChatHistory : public LLTextEditor
 		 * @param time time of a message.
 		 * @param message message itself.
 		 */
-		void appendWidgetMessage(const LLChat& chat);
+		void appendWidgetMessage(const LLChat& chat, const LLStyle::Params& input_append_params = LLStyle::Params());
 
 	private:
 		std::string mLastFromName;
diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp
index d2e3247250bc15a100c9f973483bc4ddcd95858d..1cc6b2beefc5b5ddce8671685c3182bc0c56558a 100644
--- a/indra/newview/llchatitemscontainerctrl.cpp
+++ b/indra/newview/llchatitemscontainerctrl.cpp
@@ -173,10 +173,28 @@ void LLNearbyChatToastPanel::init(LLSD& notification)
 	
 	caption->getChild<LLTextBox>("msg_time", false)->setText(appendTime() , style_params );
 
-
 	LLChatMsgBox* msg_text = getChild<LLChatMsgBox>("msg_text", false);
-	msg_text->setText(mText, style_params);
 
+
+	if(notification["chat_style"].asInteger()== CHAT_STYLE_IRC)
+	{
+		if (mFromName.size() > 0)
+		{
+			style_params.italic= true;
+			
+			msg_text->setText(mFromName, style_params);
+		}
+		mText = mText.substr(3);
+		style_params.underline = true;
+		msg_text->addText(mText,style_params);
+	}
+	else 
+	{
+		msg_text->setText(mText, style_params);
+	}
+
+
+	
 	LLUICtrl* msg_inspector = caption->getChild<LLUICtrl>("msg_inspector");
 	if(mSourceType != CHAT_SOURCE_AGENT)
 		msg_inspector->setVisible(false);
@@ -196,6 +214,8 @@ void	LLNearbyChatToastPanel::setMessage	(const LLChat& chat_msg)
 	notification["from_id"] = chat_msg.mFromID;
 	notification["time"] = chat_msg.mTime;
 	notification["source"] = (S32)chat_msg.mSourceType;
+	notification["chat_type"] = (S32)chat_msg.mChatType;
+	notification["chat_style"] = (S32)chat_msg.mChatStyle;
 	
 	std::string r_color_name="White";
 	F32 r_color_alpha = 1.0f; 
diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp
index 6d7da107ac1bce832adb3cefbc0db8b9ada5d24b..27df6be73072027463e4cac54403515e8a997455 100644
--- a/indra/newview/llexpandabletextbox.cpp
+++ b/indra/newview/llexpandabletextbox.cpp
@@ -80,7 +80,7 @@ class LLExpanderSegment : public LLTextSegment
 									draw_rect.mRight, draw_rect.mTop, 
 									mStyle->getColor(), 
 									LLFontGL::RIGHT, LLFontGL::TOP, 
-									0, 
+									mStyle->getFontStyle(), 
 									mStyle->getShadowType(), 
 									end - start, draw_rect.getWidth(), 
 									&right_x, 
@@ -164,8 +164,7 @@ void LLExpandableTextBox::LLTextBoxEx::showExpandText()
 		S32 last_line = visible_lines.second - 1;
 
 		LLStyle::Params expander_style = getDefaultStyle();
-		expander_style.font.name.setIfNotProvided(LLFontGL::nameFromFont(expander_style.font));
-		expander_style.font.style = "UNDERLINE";
+		expander_style.underline = true;
 		expander_style.color = LLUIColorTable::instance().getColor("HTMLLinkColor");
 		LLExpanderSegment* expanderp = new LLExpanderSegment(new LLStyle(expander_style), getLineStart(last_line), getLength() + 1, mExpanderLabel, *this);
 		insertSegment(expanderp);
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index e3121fbc7a5c9d06fdb427e1020acd3dc337f0bf..dff27ee032fce8c1767ed26ec99368768c3fa6cb 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -477,7 +477,33 @@ void LLIMFloater::updateMessages()
 			chat.mFromName = from;
 			chat.mText = message;
 
-			mChatHistory->appendWidgetMessage(chat);
+			LLStyle::Params append_style_params;
+			//Handle IRC styled /me messages.
+			std::string prefix = message.substr(0, 4);
+			if (prefix == "/me " || prefix == "/me'")
+			{
+				if (from.size() > 0)
+				{
+					append_style_params.italic= true;
+					chat.mText = from + " ";
+					mChatHistory->appendWidgetMessage(chat, append_style_params);
+				}
+				message = message.substr(3);
+				
+				LLColor4 txt_color = LLUIColorTable::instance().getColor("White");
+				LLViewerChat::getChatColor(chat,txt_color);
+				LLFontGL* fontp = LLViewerChat::getChatFont();
+				append_style_params.color(txt_color);
+				append_style_params.readonly_color(txt_color);
+				append_style_params.font(fontp);
+				append_style_params.underline = true;
+				mChatHistory->appendText(message, FALSE, append_style_params);
+			}
+			else
+			{
+				chat.mText = message;
+				mChatHistory->appendWidgetMessage(chat);
+			}
 
 			mLastMessageIndex = msg["index"].asInteger();
 		}
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp
index 85db69174d9a97edace9e453bed0b1730eebd5b0..68677decae48d385639d8936d3a238f242322571 100644
--- a/indra/newview/llnearbychat.cpp
+++ b/indra/newview/llnearbychat.cpp
@@ -155,7 +155,33 @@ void	LLNearbyChat::addMessage(const LLChat& chat)
 	
 	if (!chat.mMuted)
 	{
-		mChatHistory->appendWidgetMessage(chat);
+		std::string message = chat.mText;
+		std::string prefix = message.substr(0, 4);
+		if (chat.mChatStyle == CHAT_STYLE_IRC)
+		{
+			LLStyle::Params append_style_params;
+			if (chat.mFromName.size() > 0)
+			{
+				append_style_params.italic= true;
+				LLChat add_chat=chat;
+				add_chat.mText = chat.mFromName + " ";
+				mChatHistory->appendWidgetMessage(add_chat, append_style_params);
+			}
+			message = message.substr(3);
+			
+			LLColor4 txt_color = LLUIColorTable::instance().getColor("White");
+			LLViewerChat::getChatColor(chat,txt_color);
+			LLFontGL* fontp = LLViewerChat::getChatFont();
+			append_style_params.color(txt_color);
+			append_style_params.readonly_color(txt_color);
+			append_style_params.font(fontp);
+			append_style_params.underline = true;
+			mChatHistory->appendText(message, FALSE, append_style_params);
+		}
+		else
+		{
+			mChatHistory->appendWidgetMessage(chat);
+		}
 	}
 }
 
diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp
index 458845fff3fa54e8688a93786fba2b20c9cafc0c..74a75d036959ec634e353796b94e8b886519bd1b 100644
--- a/indra/newview/llnearbychathandler.cpp
+++ b/indra/newview/llnearbychathandler.cpp
@@ -341,6 +341,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg)
 		notification["time"] = chat_msg.mTime;
 		notification["source"] = (S32)chat_msg.mSourceType;
 		notification["chat_type"] = (S32)chat_msg.mChatType;
+		notification["chat_style"] = (S32)chat_msg.mChatStyle;
 		
 		std::string r_color_name = "White";
 		F32 r_color_alpha = 1.0f; 
diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp
index 1ea5f515b76e277e647698c5dbab32ac9cb70d41..3acab85bf75b0794e256b9122104b330ba6be2b1 100644
--- a/indra/newview/lltoastimpanel.cpp
+++ b/indra/newview/lltoastimpanel.cpp
@@ -56,9 +56,9 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) :	LLToastPanel(p.notif
 	if (prefix == "/me " || prefix == "/me'")
 	{
 		mMessage->clear();
-		style_params.font.style= "ITALIC";
+		style_params.italic = true;
 		mMessage->appendText(p.from + " ", FALSE, style_params);
-		style_params.font.style= "UNDERLINE";
+		style_params.underline = true;
 		mMessage->appendText(p.message.substr(3), FALSE, style_params);
 	}
 	else
diff --git a/indra/newview/llviewerchat.cpp b/indra/newview/llviewerchat.cpp
index d65a060bbc12b0a79350a37388d0b7130d26f540..ccf9ce90561151137761fb3213197bdee6fd753f 100644
--- a/indra/newview/llviewerchat.cpp
+++ b/indra/newview/llviewerchat.cpp
@@ -201,3 +201,20 @@ S32 LLViewerChat::getChatFontSize()
 {
 	return gSavedSettings.getS32("ChatFontSize");
 }
+
+
+//static
+void LLViewerChat::formatChatMsg(const LLChat& chat, std::string& formated_msg)
+{
+	std::string tmpmsg = chat.mText;
+	
+	if(chat.mChatStyle == CHAT_STYLE_IRC)
+	{
+		formated_msg = chat.mFromName + tmpmsg.substr(3);
+	}
+	else 
+	{
+		formated_msg = tmpmsg;
+	}
+
+}
\ No newline at end of file
diff --git a/indra/newview/llviewerchat.h b/indra/newview/llviewerchat.h
index d8840d5dd2466d9727602dc9de6c27db2a59177e..502d6ea7e5203c1c7204329e6cdcc02d8672e630 100644
--- a/indra/newview/llviewerchat.h
+++ b/indra/newview/llviewerchat.h
@@ -45,8 +45,7 @@ class LLViewerChat
 	static void getChatColor(const LLChat& chat, std::string& r_color_name, F32& r_color_alpha);
 	static LLFontGL* getChatFont();
 	static S32 getChatFontSize();
-	
-
+	static void formatChatMsg(const LLChat& chat, std::string& formated_msg);
 
 };
 
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 01531168870e840f536f7acc3fc6175ca778029a..ef6a621323b6c15361ca8644c9db22e003a4336a 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2343,14 +2343,14 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
 		std::string prefix = mesg.substr(0, 4);
 		if (prefix == "/me " || prefix == "/me'")
 		{
-			chat.mText = from_name;
-			chat.mText += mesg.substr(3);
+//			chat.mText = from_name;
+//			chat.mText += mesg.substr(3);
 			ircstyle = TRUE;
 		}
-		else
-		{
+//		else
+//		{
 			chat.mText = mesg;
-		}
+//		}
 
 		// Look for the start of typing so we can put "..." in the bubbles.
 		if (CHAT_TYPE_START == chat.mChatType)
@@ -2376,19 +2376,6 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
 			return;
 		}
 
-		// We have a real utterance now, so can stop showing "..." and proceed.
-		if (chatter && chatter->isAvatar())
-		{
-			LLLocalSpeakerMgr::getInstance()->setSpeakerTyping(from_id, FALSE);
-			((LLVOAvatar*)chatter)->stopTyping();
-
-			if (!is_muted && !is_busy)
-			{
-				visible_in_chat_bubble = gSavedSettings.getBOOL("UseChatBubbles");
-				((LLVOAvatar*)chatter)->addChat(chat);
-			}
-		}
-
 		// Look for IRC-style emotes
 		if (ircstyle)
 		{
@@ -2428,6 +2415,23 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
 			chat.mText += mesg;
 		}
 		
+		// We have a real utterance now, so can stop showing "..." and proceed.
+		if (chatter && chatter->isAvatar())
+		{
+			LLLocalSpeakerMgr::getInstance()->setSpeakerTyping(from_id, FALSE);
+			((LLVOAvatar*)chatter)->stopTyping();
+			
+			if (!is_muted && !is_busy)
+			{
+				visible_in_chat_bubble = gSavedSettings.getBOOL("UseChatBubbles");
+				std::string formated_msg = "";
+				LLViewerChat::formatChatMsg(chat, formated_msg);
+				LLChat chat_bubble = chat;
+				chat_bubble.mText = formated_msg;
+				((LLVOAvatar*)chatter)->addChat(chat_bubble);
+			}
+		}
+		
 		if (chatter)
 		{
 			chat.mPosAgent = chatter->getPositionAgent();