diff options
Diffstat (limited to 'indra/newview/llchathistory.cpp')
-rw-r--r-- | indra/newview/llchathistory.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index c514261b60..dcd6d25888 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -693,6 +693,7 @@ void LLChatHistory::clear() void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LLStyle::Params& input_append_params) { bool use_plain_text_chat_history = args["use_plain_text_chat_history"].asBoolean(); + bool square_brackets = false; // square brackets necessary for a system messages llassert(mEditor); if (!mEditor) @@ -736,7 +737,8 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL LLViewerChat::getChatColor(chat,txt_color); LLFontGL* fontp = LLViewerChat::getChatFont(); std::string font_name = LLFontGL::nameFromFont(fontp); - std::string font_size = LLFontGL::sizeFromFont(fontp); + std::string font_size = LLFontGL::sizeFromFont(fontp); + LLStyle::Params style_params; style_params.color(txt_color); style_params.readonly_color(txt_color); @@ -772,8 +774,9 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL // We graying out chat history by graying out messages that contains full date in a time string if (message_from_log) { - style_params.color(LLColor4::grey); - style_params.readonly_color(LLColor4::grey); + txt_color = LLColor4::grey; + style_params.color(txt_color); + style_params.readonly_color(txt_color); } bool prependNewLineState = mEditor->getText().size() != 0; @@ -781,9 +784,11 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL // show timestamps and names in the compact mode if (use_plain_text_chat_history) { + square_brackets = chat.mFromName == SYSTEM_FROM; + LLStyle::Params timestamp_style(style_params); - // timestams showing + // out of the timestamp if (args["show_time"].asBoolean()) { if (!message_from_log) @@ -796,6 +801,13 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL prependNewLineState = false; } + // out the opening square bracket (if need) + if (square_brackets) + { + mEditor->appendText("[", prependNewLineState, style_params); + prependNewLineState = false; + } + // names showing if (args["show_names_for_p2p_conv"].asBoolean() && utf8str_trim(chat.mFromName).size() != 0) { @@ -942,6 +954,11 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL message = chat.mFromName + message; } + if (square_brackets) + { + message += "]"; + } + mEditor->appendText(message, prependNewLineState, style_params); prependNewLineState = false; } |