summaryrefslogtreecommitdiff
path: root/indra/newview/llimpanel.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2009-08-18 00:05:35 +0000
committerJames Cook <james@lindenlab.com>2009-08-18 00:05:35 +0000
commit22fef0515f7a81327c42bac9126bc8accb2591fb (patch)
tree5b540c114e69685c88e018c8db0ed416645c3bca /indra/newview/llimpanel.cpp
parent8089e12b861ca10eef9fc95417a86eeb62c91a2f (diff)
EXT-495 IM windows don't autoscroll. Added track_bottom param to floater_im_session.xml text editor, as I believe there is an implicit reshape happening in the dialog. Also made the divider lines showing usernames for each IM suppress duplicates, more like local chat history. Reviewed with Leyla.
Diffstat (limited to 'indra/newview/llimpanel.cpp')
-rw-r--r--indra/newview/llimpanel.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp
index 46f3cb6998..1037ef0403 100644
--- a/indra/newview/llimpanel.cpp
+++ b/indra/newview/llimpanel.cpp
@@ -2014,6 +2014,7 @@ LLIMFloater::LLIMFloater(const LLUUID& session_id)
mControlPanel(NULL),
mSessionID(session_id),
mLastMessageIndex(-1),
+ mLastFromName(),
mDialog(IM_NOTHING_SPECIAL),
mHistoryEditor(NULL),
mInputEditor(NULL),
@@ -2232,11 +2233,13 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id)
void LLIMFloater::updateMessages()
{
-
std::list<LLSD> messages = LLIMModel::instance().getMessages(mSessionID, mLastMessageIndex+1);
if (messages.size())
{
+ LLUIColor divider_color = LLUIColorTable::instance().getColor("LtGray_50");
+ LLUIColor chat_color = LLUIColorTable::instance().getColor("IMChatColor");
+
std::ostringstream message;
std::list<LLSD>::const_reverse_iterator iter = messages.rbegin();
std::list<LLSD>::const_reverse_iterator iter_end = messages.rend();
@@ -2244,12 +2247,20 @@ void LLIMFloater::updateMessages()
{
LLSD msg = *iter;
- message << "[" << msg["time"].asString() << "] " << msg["from"].asString() << ": \n";
- mHistoryEditor->appendColoredText(message.str(), false, false, LLUIColorTable::instance().getColor("LtGray_50"));
- message.str("");
+ const bool prepend_newline = true;
+ std::string from = msg["from"].asString();
+ if (mLastFromName != from)
+ {
+ message << from << " ----- " << msg["time"].asString();
+ mHistoryEditor->appendColoredText(message.str(), false,
+ prepend_newline, divider_color);
+ message.str("");
+ mLastFromName = from;
+ }
- message << msg["message"].asString() << "\n";
- mHistoryEditor->appendColoredText(message.str(), false, false, LLUIColorTable::instance().getColor("IMChatColor"));
+ message << msg["message"].asString();
+ mHistoryEditor->appendColoredText(message.str(), false,
+ prepend_newline, chat_color);
message.str("");
mLastMessageIndex = msg["index"].asInteger();