summaryrefslogtreecommitdiff
path: root/indra/newview/llchathistory.cpp
diff options
context:
space:
mode:
authorAlexanderP ProductEngine <apaschenko@productengine.com>2012-05-14 15:44:57 +0300
committerAlexanderP ProductEngine <apaschenko@productengine.com>2012-05-14 15:44:57 +0300
commitdf58153514f6b361c65efc5dd6d31d39f68603c0 (patch)
tree83ab45717a7219e18d9ac433a2673a570afa49e8 /indra/newview/llchathistory.cpp
parent7eaeb88bc37a747ff82fd37df84592f54c88cdbf (diff)
CHUI-113 WIP all voice controls is moved from a IM-control panel to the IM floater;
IMControlPanel is removed; simplified voice button's listener behavior
Diffstat (limited to 'indra/newview/llchathistory.cpp')
-rw-r--r--indra/newview/llchathistory.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index b70e98f22b..3214c95600 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -700,9 +700,10 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
return;
}
+ bool from_me = chat.mFromID == gAgent.getID();
mEditor->setPlainText(use_plain_text_chat_history);
- if (!mEditor->scrolledToEnd() && chat.mFromID != gAgent.getID() && !chat.mFromName.empty())
+ if (!mEditor->scrolledToEnd() && !from_me && !chat.mFromName.empty())
{
mUnreadChatSources.insert(chat.mFromName);
mMoreChatPanel->setVisible(TRUE);
@@ -777,6 +778,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
bool prependNewLineState = mEditor->getText().size() != 0;
+ // show timestamps and names in the compact mode
if (use_plain_text_chat_history)
{
LLStyle::Params timestamp_style(style_params);
@@ -820,7 +822,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
LLStyle::Params link_params(style_params);
link_params.overwriteFrom(LLStyleMap::instance().lookupAgent(chat.mFromID));
- if (gAgentID == chat.mFromID)
+ if (from_me)
{ std::string localized_name;
bool is_localized = LLTrans::findString(localized_name, "AgentNameSubst");
mEditor->appendText((is_localized? localized_name:"(You)") + delimiter,
@@ -843,9 +845,9 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
}
}
}
- else
+ else // showing timestamp and name in the expanded mode
{
- prependNewLineState = 0;
+ prependNewLineState = false;
LLView* view = NULL;
LLInlineViewSegment::Params p;
p.force_newline = true;
@@ -953,7 +955,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
//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())
+ if (use_plain_text_chat_history && !from_me && chat.mFromID.notNull())
{
std::string slurl_about = SLURL_APP_AGENT + chat.mFromID.asString() + SLURL_ABOUT;
if (message.length() > slurl_about.length() &&
@@ -975,7 +977,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
mEditor->blockUndo();
// automatically scroll to end when receiving chat from myself
- if (chat.mFromID == gAgentID)
+ if (from_me)
{
mEditor->setCursorAndScrollToEnd();
}