diff options
author | AlexanderP ProductEngine <apaschenko@productengine.com> | 2012-05-04 22:08:13 +0300 |
---|---|---|
committer | AlexanderP ProductEngine <apaschenko@productengine.com> | 2012-05-04 22:08:13 +0300 |
commit | f948ba82a985c2fec5ed1e65a55bd68f6e811197 (patch) | |
tree | 672f1b433e12f6b6f29d317da4103d023383e09f /indra | |
parent | cf86247b8c5e199447b7cd3dc645a42a6a645265 (diff) |
CHUI-103 WIP Added support for showing/hiding timestamp and names, replacing own name with (You)
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llchathistory.cpp | 30 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/strings.xml | 1 |
2 files changed, 22 insertions, 9 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 5bdfb5adbc..143d4ff4fe 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -778,15 +778,19 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL if (use_plain_text_chat_history) { LLStyle::Params timestamp_style(style_params); - if (!message_from_log) + + if (args["show_time"].asBoolean()) { - LLColor4 timestamp_color = LLUIColorTable::instance().getColor("ChatTimestampColor"); - timestamp_style.color(timestamp_color); - timestamp_style.readonly_color(timestamp_color); + if (!message_from_log) + { + LLColor4 timestamp_color = LLUIColorTable::instance().getColor("ChatTimestampColor"); + timestamp_style.color(timestamp_color); + timestamp_style.readonly_color(timestamp_color); + } + mEditor->appendText("[" + chat.mTimeStr + "] ", mEditor->getText().size() != 0, timestamp_style); } - mEditor->appendText("[" + chat.mTimeStr + "] ", mEditor->getText().size() != 0, timestamp_style); - if (utf8str_trim(chat.mFromName).size() != 0) + if (args["show_names_in_p2p_chat"].asBoolean() && utf8str_trim(chat.mFromName).size() != 0) { // Don't hotlink any messages from the system (e.g. "Second Life:"), so just add those in plain text. if ( chat.mSourceType == CHAT_SOURCE_OBJECT && chat.mFromID.notNull()) @@ -806,13 +810,21 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL mEditor->appendText(chat.mFromName + delimiter, false, link_params); } - else if ( chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() && !message_from_log) + else if (chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() && !message_from_log) { LLStyle::Params link_params(style_params); link_params.overwriteFrom(LLStyleMap::instance().lookupAgent(chat.mFromID)); - // Add link to avatar's inspector and delimiter to message. - mEditor->appendText(std::string(link_params.link_href) + delimiter, false, link_params); + if (gAgentID == chat.mFromID) + { std::string localized_name; + bool is_localized = LLTrans::findString(localized_name, "AgentNameSubst"); + mEditor->appendText((is_localized? localized_name:"(You)") + delimiter, false, link_params); + } + else + { + // Add link to avatar's inspector and delimiter to message. + mEditor->appendText(std::string(link_params.link_href) + delimiter, false, link_params); + } } else { diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 9752652679..0beb8ed0ab 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -405,6 +405,7 @@ Please try logging in again in a minute.</string> <string name="TrackYourCamera">Track your camera</string> <string name="ControlYourCamera">Control your camera</string> <string name="NotConnected">Not Connected</string> + <string name="AgentNameSubst">(You)</string> <!-- Substitution for agent name --> <!-- Sim Access labels --> <string name="SIM_ACCESS_PG">General</string> |