From 884a9887a7a9e833478d266ddf8a7808cdba2ae6 Mon Sep 17 00:00:00 2001 From: Steve Bennetts Date: Wed, 18 Nov 2009 21:42:27 -0800 Subject: Changes to IM Logging, includes preference changes --- indra/newview/app_settings/settings.xml | 13 +---- .../newview/app_settings/settings_per_account.xml | 24 +------- indra/newview/llfloaterchat.cpp | 66 ++++++---------------- indra/newview/llfloaterchat.h | 8 --- indra/newview/llfloaterpreference.cpp | 29 ++-------- indra/newview/llfloaterpreference.h | 1 - indra/newview/llimview.cpp | 20 +++---- indra/newview/lllogchat.cpp | 3 - indra/newview/skins/default/xui/en/menu_viewer.xml | 11 ++++ .../default/xui/en/panel_preferences_privacy.xml | 58 ++++--------------- 10 files changed, 55 insertions(+), 178 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 74ae8db0c7..c7279a2e33 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3620,7 +3620,7 @@ Value - IMInChatConsole + IMInChat Comment Copy IM into chat console @@ -3629,17 +3629,6 @@ Type Boolean Value - 1 - - IMInChatHistory - - Comment - Copy IM into chat history - Persist - 1 - Type - Boolean - Value 0 IMShowTimestamps diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 893e7acd7a..af5fa4f388 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -22,17 +22,6 @@ Value |TOKEN COPY BusyModeResponse| - IMLogOptions - - Comment - Log options for Instant Messages - Persist - 1 - Type - S32 - Value - 2 - InstantMessageLogFolder Comment @@ -75,18 +64,7 @@ Type Boolean Value - 0 - - LogChatIM - - Comment - Log Incoming Instant Messages with Chat - Persist 1 - Type - Boolean - Value - 0 LogTimestamp @@ -97,7 +75,7 @@ Type Boolean Value - 0 + 1 LogInstantMessages diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index ed14079ae9..58025ef78b 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -180,16 +180,12 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4& edit->blockUndo(); } -void log_chat_text(const LLChat& chat) -{ - LLLogChat::saveHistory(std::string("chat"), chat.mFromName, chat.mFromID, chat.mText); -} // static void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) { - if ( (gSavedPerAccountSettings.getS32("IMLogOptions")!=LOG_IM) && log_to_file) + if (log_to_file && (gSavedPerAccountSettings.getBOOL("LogChat"))) { - log_chat_text(chat); + LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText); } LLColor4 color = get_text_color(chat); @@ -305,55 +301,27 @@ void LLFloaterChat::onClickToggleShowMute(LLUICtrl* caller, void *data) } // Put a line of chat in all the right places -void LLFloaterChat::addChat(const LLChat& chat, - BOOL from_instant_message, - BOOL local_agent) +void LLFloaterChat::addChat(const LLChat& chat, BOOL from_instant_message, BOOL local_agent) { - LLColor4 text_color = get_text_color(chat); - - BOOL invisible_script_debug_chat = ((gSavedSettings.getBOOL("ShowScriptErrors") == FALSE) || - (chat.mChatType == CHAT_TYPE_DEBUG_MSG - && (gSavedSettings.getS32("ShowScriptErrorsLocation") == 1))); - - if (!invisible_script_debug_chat - && !chat.mMuted - && gConsole - && !local_agent) - { - F32 size = CHAT_MSG_SIZE; - if (chat.mSourceType == CHAT_SOURCE_SYSTEM) - { - text_color = LLUIColorTable::instance().getColor("SystemChatColor"); - } - else if(from_instant_message) - { - text_color = LLUIColorTable::instance().getColor("IMChatColor"); - size = INSTANT_MSG_SIZE; - } - // Disabling the console for 2.0 - SJB -#if 0 - // We display anything if it's not an IM. If it's an IM, check pref... - if ( !from_instant_message || gSavedSettings.getBOOL("IMInChatConsole") ) - { - gConsole->addLine(chat.mText, size, text_color); - } -#endif - } - - if(from_instant_message && (gSavedPerAccountSettings.getS32("IMLogOptions")== LOG_BOTH_TOGETHER)) - log_chat_text(chat); - - if(from_instant_message && gSavedSettings.getBOOL("IMInChatHistory")) - addChatHistory(chat,false); - triggerAlerts(chat.mText); // Add the sender to the list of people with which we've recently interacted. if(chat.mSourceType == CHAT_SOURCE_AGENT && chat.mFromID.notNull()) LLRecentPeople::instance().add(chat.mFromID); - - if(!from_instant_message) - addChatHistory(chat); + + bool add_chat = true; + bool log_chat = true; + if(from_instant_message) + { + if (!gSavedSettings.getBOOL("IMInChat")) + add_chat = false; + //log_chat = false; +} + + if (add_chat) + { + addChatHistory(chat, log_chat); + } } // Moved from lltextparser.cpp to break llui/llaudio library dependency. diff --git a/indra/newview/llfloaterchat.h b/indra/newview/llfloaterchat.h index aed82a6781..84fc199bfa 100644 --- a/indra/newview/llfloaterchat.h +++ b/indra/newview/llfloaterchat.h @@ -45,14 +45,6 @@ class LLChat; class LLPanelActiveSpeakers; class LLLogChat; -enum ELogOptions -{ - LOG_CHAT = 0, - LOG_IM = 1, - LOG_BOTH_TOGETHER = 2, - LOG_BOTH_SEPARATE = 3 -}; - class LLFloaterChat : public LLFloater { public: diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 4434a8013d..7fc207d395 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -338,7 +338,6 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.ClickEnablePopup", boost::bind(&LLFloaterPreference::onClickEnablePopup, this)); mCommitCallbackRegistrar.add("Pref.ClickDisablePopup", boost::bind(&LLFloaterPreference::onClickDisablePopup, this)); mCommitCallbackRegistrar.add("Pref.LogPath", boost::bind(&LLFloaterPreference::onClickLogPath, this)); - mCommitCallbackRegistrar.add("Pref.Logging", boost::bind(&LLFloaterPreference::onCommitLogging, this)); mCommitCallbackRegistrar.add("Pref.UpdateMeterText", boost::bind(&LLFloaterPreference::updateMeterText, this, _1)); mCommitCallbackRegistrar.add("Pref.HardwareSettings", boost::bind(&LLFloaterPreference::onOpenHardwareSettings, this)); mCommitCallbackRegistrar.add("Pref.HardwareDefaults", boost::bind(&LLFloaterPreference::setHardwareDefaults, this)); @@ -1133,27 +1132,6 @@ void LLFloaterPreference::onClickLogPath() gSavedPerAccountSettings.setString("InstantMessageLogFolder",chat_log_top_folder); } -void LLFloaterPreference::onCommitLogging() -{ - enableHistory(); -} - -void LLFloaterPreference::enableHistory() -{ - if (childGetValue("log_instant_messages").asBoolean()) - { - childEnable("ChatIMLogs"); - childEnable("log_path_button"); - childEnable("show_timestamps_check_im"); - } - else - { - childDisable("ChatIMLogs"); - childDisable("log_path_button"); - childDisable("show_timestamps_check_im"); - } -} - void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email) { mGotPersonalInfo = true; @@ -1193,7 +1171,12 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im // childSetText("busy_response", gSavedSettings.getString("BusyModeResponse2")); - enableHistory(); + childEnable("log_nearby_chat"); + childEnable("log_instant_messages"); + childEnable("show_timestamps_check_im"); + childEnable("log_path_string"); + childEnable("log_path_button"); + std::string display_email(email); childSetText("email_address",display_email); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 10f39e46f1..41c8bb7124 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -115,7 +115,6 @@ public: void setAllIgnored(); void onClickLogPath(); void enableHistory(); - void onCommitLogging(); void setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email); void refreshEnabledState(); void disableUnavailableSettings(); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 54b7c124e0..c066f1f77a 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -395,21 +395,15 @@ bool LLIMModel::addToHistory(const LLUUID& session_id, const std::string& from, bool LLIMModel::logToFile(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text) { - S32 im_log_option = gSavedPerAccountSettings.getS32("IMLogOptions"); - if (im_log_option != LOG_CHAT) + if (gSavedPerAccountSettings.getBOOL("LogInstantMessages")) { - if(im_log_option == LOG_BOTH_TOGETHER) - { - LLLogChat::saveHistory(std::string("chat"), from, from_id, utf8_text); - return true; - } - else - { - LLLogChat::saveHistory(LLIMModel::getInstance()->getName(session_id), from, from_id, utf8_text); - return true; - } + LLLogChat::saveHistory(LLIMModel::getInstance()->getName(session_id), from, from_id, utf8_text); + return true; + } + else + { + return false; } - return false; } bool LLIMModel::proccessOnlineOfflineNotification( diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index a16ffe19c6..941ccc227c 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -96,9 +96,6 @@ void LLLogChat::saveHistory(const std::string& filename, const LLUUID& from_id, const std::string& line) { - if (!gSavedPerAccountSettings.getBOOL("LogInstantMessages")) - return; - if(!filename.size()) { llinfos << "Filename is Empty!" << llendl; diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index ccf6b08ed7..077667a3fc 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1642,6 +1642,17 @@ function="ToggleControl" parameter="MouseSmooth" /> + + + + + + - - - - - - -