summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorSteve Bennetts <steve@lindenlab.com>2009-11-18 21:42:27 -0800
committerSteve Bennetts <steve@lindenlab.com>2009-11-18 21:42:27 -0800
commit884a9887a7a9e833478d266ddf8a7808cdba2ae6 (patch)
tree459955d55e0d7fb18a4a9ba92531f99cabeac0f5 /indra/newview
parent7803ba8e0c9e3618bdc2f98289293db36544331d (diff)
Changes to IM Logging, includes preference changes
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml13
-rw-r--r--indra/newview/app_settings/settings_per_account.xml24
-rw-r--r--indra/newview/llfloaterchat.cpp66
-rw-r--r--indra/newview/llfloaterchat.h8
-rw-r--r--indra/newview/llfloaterpreference.cpp29
-rw-r--r--indra/newview/llfloaterpreference.h1
-rw-r--r--indra/newview/llimview.cpp20
-rw-r--r--indra/newview/lllogchat.cpp3
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml11
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_privacy.xml58
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 @@
<key>Value</key>
<string />
</map>
- <key>IMInChatConsole</key>
+ <key>IMInChat</key>
<map>
<key>Comment</key>
<string>Copy IM into chat console</string>
@@ -3629,17 +3629,6 @@
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
- <integer>1</integer>
- </map>
- <key>IMInChatHistory</key>
- <map>
- <key>Comment</key>
- <string>Copy IM into chat history</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
<integer>0</integer>
</map>
<key>IMShowTimestamps</key>
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 @@
<key>Value</key>
<string>|TOKEN COPY BusyModeResponse|</string>
</map>
- <key>IMLogOptions</key>
- <map>
- <key>Comment</key>
- <string>Log options for Instant Messages</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>S32</string>
- <key>Value</key>
- <integer>2</integer>
- </map>
<key>InstantMessageLogFolder</key>
<map>
<key>Comment</key>
@@ -75,18 +64,7 @@
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
- <integer>0</integer>
- </map>
- <key>LogChatIM</key>
- <map>
- <key>Comment</key>
- <string>Log Incoming Instant Messages with Chat</string>
- <key>Persist</key>
<integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>0</integer>
</map>
<key>LogTimestamp</key>
<map>
@@ -97,7 +75,7 @@
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
- <integer>0</integer>
+ <integer>1</integer>
</map>
<key>LogInstantMessages</key>
<map>
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" />
</menu_item_check>
+ <menu_item_check
+ label="Show IMs in Nearby Chat"
+ layout="topleft"
+ name="IMInChat">
+ <menu_item_check.on_check
+ function="CheckControl"
+ parameter="IMInChat" />
+ <menu_item_check.on_click
+ function="ToggleControl"
+ parameter="IMInChat" />
+ </menu_item_check>
<menu_item_separator
layout="topleft" />
<menu
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml
index 8c22a5e483..1b9a99f90b 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml
@@ -100,61 +100,27 @@
Logs:
</text>
<check_box
-
+ enabled="false"
+ control_name="LogChat"
+ height="16"
+ label="Save nearby chat logs on my computer"
+ layout="topleft"
+ left="30"
+ name="log_nearby_chat"
+ top_pad="10"
+ width="350">
+ </check_box>
+ <check_box
enabled="false"
control_name="LogInstantMessages"
height="16"
- label="Save logs on my computer"
+ label="Save IM logs on my computer"
layout="topleft"
left="30"
name="log_instant_messages"
top_pad="10"
width="350">
- <check_box.commit_callback
- function="Pref.Logging" />
</check_box>
- <radio_group
- control_name="IMLogOptions"
- enabled="false"
- height="80"
- layout="topleft"
- left_delta="50"
- name="ChatIMLogs"
- width="350"
- top_pad="0">
- <radio_item
- height="16"
- label="Chat"
- layout="topleft"
- left="0"
- name="radio1"
- top="3"
- width="200" />
- <radio_item
- height="16"
- label="IM"
- layout="topleft"
- left_delta="0"
- name="radio2"
- top_pad="3"
- width="200" />
- <radio_item
- height="16"
- label="Both, together"
- layout="topleft"
- left_delta="0"
- name="radio3"
- top_pad="3"
- width="200" />
- <radio_item
- height="16"
- label="Both, separate"
- layout="topleft"
- left_delta="0"
- name="radio4"
- top_pad="3"
- width="200" />
- </radio_group>
<check_box
control_name="LogTimestamp"
enabled="false"