aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloaterchat.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:59 -0500
committerJacek Antonelli2008-08-15 23:44:59 -0500
commita408bac29378072fbf36864164149458c978cfcc (patch)
tree67feccf1a5d3816611ba48d6762f86f0f7f4b1f6 /linden/indra/newview/llfloaterchat.cpp
parentSecond Life viewer sources 1.17.0.12 (diff)
downloadmeta-impy-a408bac29378072fbf36864164149458c978cfcc.zip
meta-impy-a408bac29378072fbf36864164149458c978cfcc.tar.gz
meta-impy-a408bac29378072fbf36864164149458c978cfcc.tar.bz2
meta-impy-a408bac29378072fbf36864164149458c978cfcc.tar.xz
Second Life viewer sources 1.17.1.0
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llfloaterchat.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp
index d31532f..5e416d4 100644
--- a/linden/indra/newview/llfloaterchat.cpp
+++ b/linden/indra/newview/llfloaterchat.cpp
@@ -150,12 +150,22 @@ void add_timestamped_line(LLViewerTextEditor* edit, const LLString& line, const
150 edit->appendColoredText(line, false, prepend_newline, color); 150 edit->appendColoredText(line, false, prepend_newline, color);
151} 151}
152 152
153void log_chat_text(const LLChat& chat)
154{
155 LLString histstr;
156 if (gSavedPerAccountSettings.getBOOL("LogChatTimestamp"))
157 histstr = LLLogChat::timestamp(gSavedPerAccountSettings.getBOOL("LogTimestampDate")) + chat.mText;
158 else
159 histstr = chat.mText;
160
161 LLLogChat::saveHistory("chat",histstr);
162}
153// static 163// static
154void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) 164void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
155{ 165{
156 if ( gSavedPerAccountSettings.getBOOL("LogChat") && log_to_file) 166 if ( gSavedPerAccountSettings.getBOOL("LogChat") && log_to_file)
157 { 167 {
158 LLLogChat::saveHistory("chat",chat.mText); 168 log_chat_text(chat);
159 } 169 }
160 170
161 LLColor4 color = get_text_color(chat); 171 LLColor4 color = get_text_color(chat);
@@ -364,10 +374,14 @@ void LLFloaterChat::addChat(const LLChat& chat,
364 gConsole->addLine(chat.mText, size, text_color); 374 gConsole->addLine(chat.mText, size, text_color);
365 } 375 }
366 376
367 if( !from_instant_message || gSavedSettings.getBOOL("IMInChatHistory") ) 377 if(from_instant_message && gSavedPerAccountSettings.getBOOL("LogChatIM"))
368 { 378 log_chat_text(chat);
379
380 if(from_instant_message && gSavedSettings.getBOOL("IMInChatHistory"))
381 addChatHistory(chat,false);
382
383 if(!from_instant_message)
369 addChatHistory(chat); 384 addChatHistory(chat);
370 }
371} 385}
372 386
373LLColor4 get_text_color(const LLChat& chat) 387LLColor4 get_text_color(const LLChat& chat)
@@ -400,6 +414,10 @@ LLColor4 get_text_color(const LLChat& chat)
400 { 414 {
401 text_color = gSavedSettings.getColor4("ScriptErrorColor"); 415 text_color = gSavedSettings.getColor4("ScriptErrorColor");
402 } 416 }
417 else if ( chat.mChatType == CHAT_TYPE_OWNER )
418 {
419 text_color = gSavedSettings.getColor4("llOwnerSayChatColor");
420 }
403 else 421 else
404 { 422 {
405 text_color = gSavedSettings.getColor4("ObjectChatColor"); 423 text_color = gSavedSettings.getColor4("ObjectChatColor");