summaryrefslogtreecommitdiff
path: root/indra/newview/llchathistory.cpp
diff options
context:
space:
mode:
authorAlexanderP ProductEngine <apaschenko@productengine.com>2012-05-07 21:54:09 +0300
committerAlexanderP ProductEngine <apaschenko@productengine.com>2012-05-07 21:54:09 +0300
commit7b8251fd2f169136fc45e4c17104da676f75727b (patch)
tree89898a727d8e892be05383a6a9f19c36ce04dc76 /indra/newview/llchathistory.cpp
parent79928c65329146920558d9bc286f643ccf8dca7f (diff)
CHUI-103 WIP Added settings for switching text view mode
Diffstat (limited to 'indra/newview/llchathistory.cpp')
-rw-r--r--indra/newview/llchathistory.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index 30b2839547..b70e98f22b 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -775,7 +775,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
style_params.readonly_color(LLColor4::grey);
}
- mPrependNewLineState = (mEditor->getText().size() != 0)? 1 : 0;
+ bool prependNewLineState = mEditor->getText().size() != 0;
if (use_plain_text_chat_history)
{
@@ -790,11 +790,12 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
timestamp_style.color(timestamp_color);
timestamp_style.readonly_color(timestamp_color);
}
- mEditor->appendText("[" + chat.mTimeStr + "] ", isNeedPrependNewline(), timestamp_style);
+ mEditor->appendText("[" + chat.mTimeStr + "] ", prependNewLineState, timestamp_style);
+ prependNewLineState = false;
}
// names showing
- if (args["show_names_in_p2p_chat"].asBoolean() && utf8str_trim(chat.mFromName).size() != 0)
+ if (args["show_names_for_p2p_conv"].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())
@@ -811,7 +812,8 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
link_params.is_link = true;
link_params.link_href = url;
- mEditor->appendText(chat.mFromName + delimiter, isNeedPrependNewline(), link_params);
+ mEditor->appendText(chat.mFromName + delimiter, prependNewLineState, link_params);
+ prependNewLineState = false;
}
else if (chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() && !message_from_log)
{
@@ -822,25 +824,28 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
{ std::string localized_name;
bool is_localized = LLTrans::findString(localized_name, "AgentNameSubst");
mEditor->appendText((is_localized? localized_name:"(You)") + delimiter,
- isNeedPrependNewline(), link_params);
+ prependNewLineState, link_params);
+ prependNewLineState = false;
}
else
{
// Add link to avatar's inspector and delimiter to message.
mEditor->appendText(std::string(link_params.link_href) + delimiter,
- isNeedPrependNewline(), link_params);
+ prependNewLineState, link_params);
+ prependNewLineState = false;
}
}
else
{
mEditor->appendText("<nolink>" + chat.mFromName + "</nolink>" + delimiter,
- isNeedPrependNewline(), style_params);
+ prependNewLineState, style_params);
+ prependNewLineState = false;
}
}
}
else
{
- mPrependNewLineState = 0;
+ prependNewLineState = 0;
LLView* view = NULL;
LLInlineViewSegment::Params p;
p.force_newline = true;
@@ -963,7 +968,8 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
message = chat.mFromName + message;
}
- mEditor->appendText(message, isNeedPrependNewline(), style_params);
+ mEditor->appendText(message, prependNewLineState, style_params);
+ prependNewLineState = false;
}
mEditor->blockUndo();