aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterchat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llfloaterchat.cpp')
-rw-r--r--linden/indra/newview/llfloaterchat.cpp34
1 files changed, 21 insertions, 13 deletions
diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp
index 383a33e..1f0c6ad 100644
--- a/linden/indra/newview/llfloaterchat.cpp
+++ b/linden/indra/newview/llfloaterchat.cpp
@@ -75,8 +75,8 @@
75#include "llstylemap.h" 75#include "llstylemap.h"
76 76
77// Used for LCD display 77// Used for LCD display
78extern void AddNewIMToLCD(const LLString &newLine); 78extern void AddNewIMToLCD(const std::string &newLine);
79extern void AddNewChatToLCD(const LLString &newLine); 79extern void AddNewChatToLCD(const std::string &newLine);
80// 80//
81// Constants 81// Constants
82// 82//
@@ -94,7 +94,7 @@ LLColor4 get_text_color(const LLChat& chat);
94// Member Functions 94// Member Functions
95// 95//
96LLFloaterChat::LLFloaterChat(const LLSD& seed) 96LLFloaterChat::LLFloaterChat(const LLSD& seed)
97: LLFloater("chat floater", "FloaterChatRect", "", 97: LLFloater(std::string("chat floater"), std::string("FloaterChatRect"), LLStringUtil::null,
98 RESIZE_YES, 440, 100, DRAG_ON_TOP, MINIMIZE_NO, CLOSE_YES), 98 RESIZE_YES, 440, 100, DRAG_ON_TOP, MINIMIZE_NO, CLOSE_YES),
99 mPanel(NULL) 99 mPanel(NULL)
100{ 100{
@@ -191,7 +191,7 @@ void LLFloaterChat::updateConsoleVisibility()
191 191
192void add_timestamped_line(LLViewerTextEditor* edit, const LLChat &chat, const LLColor4& color) 192void add_timestamped_line(LLViewerTextEditor* edit, const LLChat &chat, const LLColor4& color)
193{ 193{
194 LLString line = chat.mText; 194 std::string line = chat.mText;
195 bool prepend_newline = true; 195 bool prepend_newline = true;
196 if (gSavedSettings.getBOOL("ChatShowTimestamps")) 196 if (gSavedSettings.getBOOL("ChatShowTimestamps"))
197 { 197 {
@@ -205,9 +205,10 @@ void add_timestamped_line(LLViewerTextEditor* edit, const LLChat &chat, const LL
205 chat.mFromID != LLUUID::null && 205 chat.mFromID != LLUUID::null &&
206 (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0)) 206 (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0))
207 { 207 {
208 line = line.substr(chat.mFromName.length()); 208 std::string start_line = line.substr(0, chat.mFromName.length() + 1);
209 line = line.substr(chat.mFromName.length() + 1);
209 const LLStyleSP &sourceStyle = LLStyleMap::instance().lookup(chat.mFromID); 210 const LLStyleSP &sourceStyle = LLStyleMap::instance().lookup(chat.mFromID);
210 edit->appendStyledText(chat.mFromName, false, prepend_newline, &sourceStyle); 211 edit->appendStyledText(start_line, false, prepend_newline, &sourceStyle);
211 prepend_newline = false; 212 prepend_newline = false;
212 } 213 }
213 edit->appendColoredText(line, false, prepend_newline, color); 214 edit->appendColoredText(line, false, prepend_newline, color);
@@ -215,13 +216,13 @@ void add_timestamped_line(LLViewerTextEditor* edit, const LLChat &chat, const LL
215 216
216void log_chat_text(const LLChat& chat) 217void log_chat_text(const LLChat& chat)
217{ 218{
218 LLString histstr; 219 std::string histstr;
219 if (gSavedPerAccountSettings.getBOOL("LogChatTimestamp")) 220 if (gSavedPerAccountSettings.getBOOL("LogChatTimestamp"))
220 histstr = LLLogChat::timestamp(gSavedPerAccountSettings.getBOOL("LogTimestampDate")) + chat.mText; 221 histstr = LLLogChat::timestamp(gSavedPerAccountSettings.getBOOL("LogTimestampDate")) + chat.mText;
221 else 222 else
222 histstr = chat.mText; 223 histstr = chat.mText;
223 224
224 LLLogChat::saveHistory("chat",histstr); 225 LLLogChat::saveHistory(std::string("chat"),histstr);
225} 226}
226// static 227// static
227void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) 228void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
@@ -304,7 +305,7 @@ void LLFloaterChat::onClickMute(void *data)
304 305
305 LLComboBox* chatter_combo = self->getChild<LLComboBox>("chatter combobox"); 306 LLComboBox* chatter_combo = self->getChild<LLComboBox>("chatter combobox");
306 307
307 const LLString& name = chatter_combo->getSimple(); 308 const std::string& name = chatter_combo->getSimple();
308 LLUUID id = chatter_combo->getCurrentID(); 309 LLUUID id = chatter_combo->getCurrentID();
309 310
310 if (name.empty()) return; 311 if (name.empty()) return;
@@ -356,7 +357,7 @@ void LLFloaterChat::addChat(const LLChat& chat,
356 chat.mChatType == CHAT_TYPE_DEBUG_MSG 357 chat.mChatType == CHAT_TYPE_DEBUG_MSG
357 && !gSavedSettings.getBOOL("ScriptErrorsAsChat"); 358 && !gSavedSettings.getBOOL("ScriptErrorsAsChat");
358 359
359#if LL_WINDOWS && LL_LCD_COMPILE 360#if LL_LCD_COMPILE
360 // add into LCD displays 361 // add into LCD displays
361 if (!invisible_script_debug_chat) 362 if (!invisible_script_debug_chat)
362 { 363 {
@@ -420,7 +421,14 @@ LLColor4 get_text_color(const LLChat& chat)
420 } 421 }
421 else 422 else
422 { 423 {
423 text_color = gSavedSettings.getColor4("AgentChatColor"); 424 if(gAgent.getID() == chat.mFromID)
425 {
426 text_color = gSavedSettings.getColor4("UserChatColor");
427 }
428 else
429 {
430 text_color = gSavedSettings.getColor4("AgentChatColor");
431 }
424 } 432 }
425 break; 433 break;
426 case CHAT_SOURCE_OBJECT: 434 case CHAT_SOURCE_OBJECT:
@@ -459,11 +467,11 @@ LLColor4 get_text_color(const LLChat& chat)
459//static 467//static
460void LLFloaterChat::loadHistory() 468void LLFloaterChat::loadHistory()
461{ 469{
462 LLLogChat::loadHistory("chat", &chatFromLogFile, (void *)LLFloaterChat::getInstance(LLSD())); 470 LLLogChat::loadHistory(std::string("chat"), &chatFromLogFile, (void *)LLFloaterChat::getInstance(LLSD()));
463} 471}
464 472
465//static 473//static
466void LLFloaterChat::chatFromLogFile(LLLogChat::ELogLineType type , LLString line, void* userdata) 474void LLFloaterChat::chatFromLogFile(LLLogChat::ELogLineType type , std::string line, void* userdata)
467{ 475{
468 switch (type) 476 switch (type)
469 { 477 {