diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index 2ccd6b7d350555d5fce84c7f03d6dd31d6a95cb0..056f2ee333d7cf8181de13be287d42b3aa03d899 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -370,8 +370,7 @@ void LLChatHistory::appendWidgetMessage(const LLChat& chat, LLStyle::Params& sty
 	appendWidget(p, view_text, false);
 
 	//Append the text message
-	std::string message = chat.mText + '\n';
-	appendText(message, FALSE, style_params);
+	appendText(chat.mText, FALSE, style_params);
 
 	mLastFromName = chat.mFromName;
 	blockUndo();
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index a634a1b0fd05d17878e07f13d99f33e9db866c97..8b44ccebdde1f567719a1bc782f409f8fddd4c48 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -479,11 +479,29 @@ void LLIMFloater::updateMessages()
 			LLStyle::Params style_params;
 			style_params.color(chat_color);
 
-			LLChat chat(message);
+			LLChat chat;
 			chat.mFromID = from_id;
 			chat.mFromName = from;
 
-			mChatHistory->appendWidgetMessage(chat, style_params);
+			//Handle IRC styled /me messages.
+			std::string prefix = message.substr(0, 4);
+			if (prefix == "/me " || prefix == "/me'")
+			{
+				if (from.size() > 0)
+				{
+					style_params.font.style = "ITALIC";
+					chat.mText = from + " ";
+					mChatHistory->appendWidgetMessage(chat, style_params);
+				}
+				message = message.substr(3);
+				style_params.font.style = "UNDERLINE";
+				mChatHistory->appendText(message, FALSE, style_params);
+			}
+			else
+			{
+				chat.mText = message;
+				mChatHistory->appendWidgetMessage(chat, style_params);
+			}
 
 			mLastMessageIndex = msg["index"].asInteger();
 		}
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 476d312c69b75d923ed575b9c9d48276cd84f25b..e894022e52818193672650d9dfaa4a2fe896c02a 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -651,22 +651,10 @@ void LLIMModel::sendMessage(const std::string& utf8_text,
 
 		//local echo for the legacy communicate panel
 		std::string history_echo;
-		std::string utf8_copy = utf8_text;
 		LLAgentUI::buildFullname(history_echo);
 
-		// Look for IRC-style emotes here.
+		history_echo += ": " + utf8_text;
 
-		std::string prefix = utf8_copy.substr(0, 4);
-		if (prefix == "/me " || prefix == "/me'")
-		{
-			utf8_copy.replace(0,3,"");
-		}
-		else
-		{
-			history_echo += ": ";
-		}
-		history_echo += utf8_copy;
-		
 		LLFloaterIMPanel* floater = gIMMgr->findFloaterBySession(im_session_id);
 		if (floater) floater->addHistoryLine(history_echo, LLUIColorTable::instance().getColor("IMChatColor"), true, gAgent.getID());
 
@@ -2337,15 +2325,6 @@ class LLViewerChatterBoxInvitation : public LLHTTPNode
 
 			BOOL is_linden = LLMuteList::getInstance()->isLinden(name);
 			std::string separator_string(": ");
-			int message_offset=0;
-
-			//Handle IRC styled /me messages.
-			std::string prefix = message.substr(0, 4);
-			if (prefix == "/me " || prefix == "/me'")
-			{
-				separator_string = "";
-				message_offset = 3;
-			}
 			
 			chat.mMuted = is_muted && !is_linden;
 			chat.mFromID = from_id;
@@ -2362,7 +2341,7 @@ class LLViewerChatterBoxInvitation : public LLHTTPNode
 			{
 				saved = llformat("(Saved %s) ", formatted_time(timestamp).c_str());
 			}
-			std::string buffer = saved + message.substr(message_offset);
+			std::string buffer = saved + message;
 
 			BOOL is_this_agent = FALSE;
 			if(from_id == gAgentID)
@@ -2381,7 +2360,7 @@ class LLViewerChatterBoxInvitation : public LLHTTPNode
 				ll_vector3_from_sd(message_params["position"]),
 				true);
 
-			chat.mText = std::string("IM: ") + name + separator_string + saved + message.substr(message_offset);
+			chat.mText = std::string("IM: ") + name + separator_string + saved + message;
 			LLFloaterChat::addChat(chat, TRUE, is_this_agent);
 
 			//K now we want to accept the invitation
diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp
index c02fd7a5eff956eccd2227ce82e48ed14d429150..9370e318cfbc5a87a692830c890a02600fc8076a 100644
--- a/indra/newview/lltoastimpanel.cpp
+++ b/indra/newview/lltoastimpanel.cpp
@@ -50,7 +50,19 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) :	LLToastPanel(p.notif
 	mMessage = getChild<LLTextBox>("message");
 	mReplyBtn = getChild<LLButton>("reply");	
 
-	mMessage->setValue(p.message);
+	LLStyle::Params style_params;
+	//Handle IRC styled /me messages.
+	std::string prefix = p.message.substr(0, 4);
+	if (prefix == "/me " || prefix == "/me'")
+	{
+		mMessage->clear();
+		style_params.font.style= "ITALIC";
+		mMessage->appendText(p.from + " ", FALSE, style_params);
+		style_params.font.style= "UNDERLINE";
+		mMessage->appendText(p.message.substr(3), FALSE, style_params);
+	}
+	else
+		mMessage->setValue(p.message);
 	mUserName->setValue(p.from);
 	mTime->setValue(p.time);
 	mSessionID = p.session_id;
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index ea1097c47794aa8c03956684e35f75a66c9a8e0b..bb61b4e16fc23eb3e2ecafa2b625612af853f8b1 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -1498,15 +1498,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 	}
 
 	std::string separator_string(": ");
-	int message_offset = 0;
-
-		//Handle IRC styled /me messages.
-	std::string prefix = message.substr(0, 4);
-	if (prefix == "/me " || prefix == "/me'")
-	{
-		separator_string = "";
-		message_offset = 3;
-	}
 
 	LLSD args;
 	switch(dialog)
@@ -1558,7 +1549,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 
 			// now store incoming IM in chat history
 
-			buffer = message.substr(message_offset);
+			buffer = message;
 	
 			LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL;
 
@@ -1576,7 +1567,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 				true);
 
 			// pretend this is chat generated by self, so it does not show up on screen
-			chat.mText = std::string("IM: ") + name + separator_string + message.substr(message_offset);
+			chat.mText = std::string("IM: ") + name + separator_string + message;
 			LLFloaterChat::addChat( chat, TRUE, TRUE );
 		}
 		else if (from_id.isNull())
@@ -1596,7 +1587,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 			// Treat like a system message and put in chat history.
 			// Claim to be from a local agent so it doesn't go into
 			// console.
-			chat.mText = name + separator_string + message.substr(message_offset);
+			chat.mText = name + separator_string + message;
 
 			LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD());
 			if(nearby_chat)
@@ -1612,7 +1603,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 			{
 				saved = llformat("(Saved %s) ", formatted_time(timestamp).c_str());
 			}
-			buffer = saved + message.substr(message_offset);
+			buffer = saved + message;
 
 			LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL;
 
@@ -1634,7 +1625,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 					region_id,
 					position,
 					true);
-				chat.mText = std::string("IM: ") + name + separator_string + saved + message.substr(message_offset);
+				chat.mText = std::string("IM: ") + name + separator_string + saved + message;
 
 				BOOL local_agent = FALSE;
 				LLFloaterChat::addChat( chat, TRUE, local_agent );
@@ -1922,7 +1913,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 		{
 			saved = llformat("(Saved %s) ", formatted_time(timestamp).c_str());
 		}
-		buffer = saved + message.substr(message_offset);
+		buffer = saved + message;
 		BOOL is_this_agent = FALSE;
 		if(from_id == gAgentID)
 		{
@@ -1940,7 +1931,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 			position,
 			true);
 
-		chat.mText = std::string("IM: ") + name + separator_string +  saved + message.substr(message_offset);
+		chat.mText = std::string("IM: ") + name + separator_string +  saved + message;
 		LLFloaterChat::addChat(chat, TRUE, is_this_agent);
 	}
 	break;
@@ -1953,7 +1944,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 			}
 
 			LLSD substitutions;
-			substitutions["MSG"] = message.substr(message_offset);
+			substitutions["MSG"] = message;
 			LLNotifications::instance().add("ServerObjectMessage", substitutions);
 		}
 		break;
@@ -1978,7 +1969,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
 		else
 		{
 			// TODO: after LLTrans hits release, get "busy response" into translatable file
-			buffer = llformat("%s (%s): %s", name.c_str(), "busy response", message.substr(message_offset).c_str());
+			buffer = llformat("%s (%s): %s", name.c_str(), "busy response", message.c_str());
 			gIMMgr->addMessage(session_id, from_id, name, buffer);
 		}
 		break;
diff --git a/indra/newview/skins/default/xui/en/panel_instant_message.xml b/indra/newview/skins/default/xui/en/panel_instant_message.xml
index 26d8304551d543ea4aff4c9f8932ae0c74ab56c3..be568661193968456605b9987422232100d82fab 100644
--- a/indra/newview/skins/default/xui/en/panel_instant_message.xml
+++ b/indra/newview/skins/default/xui/en/panel_instant_message.xml
@@ -79,7 +79,7 @@
      text_color="white"
      top="33"
      use_ellipses="true"
-     value="MESSAGE"
+     value=""
      width="285"
      word_wrap="true"
      max_length="350" />