diff options
-rw-r--r-- | indra/newview/llchathistory.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llimfloater.cpp | 22 | ||||
-rw-r--r-- | indra/newview/llimview.cpp | 27 | ||||
-rw-r--r-- | indra/newview/lltoastimpanel.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llviewermessage.cpp | 27 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_instant_message.xml | 2 |
6 files changed, 47 insertions, 48 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 2ccd6b7d35..056f2ee333 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 a634a1b0fd..8b44ccebdd 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 476d312c69..e894022e52 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 @@ public: 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 @@ public: { 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 @@ public: 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 c02fd7a5ef..9370e318cf 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 ea1097c477..bb61b4e16f 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 26d8304551..be56866119 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" /> |