From 5a1ef0214a904d13d942059420b412eaf5d7017e Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Mon, 15 Feb 2010 16:43:52 +0200 Subject: fixed EXT-5010 Redundant resident name in the IM log for offers --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 9368d9cb7c..81cc52528c 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -68,6 +68,9 @@ const static std::string NEW_LINE(rawstr_to_utf8("\n")); const static U32 LENGTH_OF_TIME_STR = std::string("12:00").length(); +const static std::string SLURL_APP_AGENT = "secondlife:///app/agent/"; +const static std::string SLURL_ABOUT = "/about"; + // support for secondlife:///app/objectim/{UUID}/ SLapps class LLObjectIMHandler : public LLCommandHandler { @@ -779,6 +782,20 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL else { std::string message = irc_me ? chat.mText.substr(3) : chat.mText; + + + //MESSAGE TEXT PROCESSING + //*HACK getting rid of redundant sender names in system notifications sent using sender name (see EXT-5010) + if (use_plain_text_chat_history && gAgentID != chat.mFromID && chat.mFromID.notNull()) + { + std::string slurl_about = SLURL_APP_AGENT + chat.mFromID.asString() + SLURL_ABOUT; + if (message.length() > slurl_about.length() && + message.compare(0, slurl_about.length(), slurl_about) == 0) + { + message = message.substr(slurl_about.length(), message.length()-1); + } + } + mEditor->appendText(message, FALSE, style_params); } mEditor->blockUndo(); -- cgit v1.2.3