summaryrefslogtreecommitdiff
path: root/indra/newview
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
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')
-rw-r--r--indra/newview/llimpanel.cpp23
-rw-r--r--indra/newview/llimpanel.h3
-rw-r--r--indra/newview/skins/default/xui/en/floater_im_session.xml1
3 files changed, 21 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();
diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h
index 8650d8fa07..d35aca0e42 100644
--- a/indra/newview/llimpanel.h
+++ b/indra/newview/llimpanel.h
@@ -413,6 +413,9 @@ private:
LLPanelChatControlPanel* mControlPanel;
LLUUID mSessionID;
S32 mLastMessageIndex;
+ // username of last user who added text to this conversation, used to
+ // suppress duplicate username divider bars
+ std::string mLastFromName;
EInstantMessage mDialog;
LLUUID mOtherParticipantUUID;
LLViewerTextEditor* mHistoryEditor;
diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml
index 61c98299a0..a102d64587 100644
--- a/indra/newview/skins/default/xui/en/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_session.xml
@@ -55,6 +55,7 @@
layout="topleft"
max_length="2147483647"
name="im_text"
+ track_bottom="true"
width="195"
word_wrap="true">
</text_editor>