Skip to content
Snippets Groups Projects
Commit bbe9b636 authored by Mike Antipov's avatar Mike Antipov
Browse files

Fixed major bug EXT-6661 (chat log paths reset back to default)

 * Removed unused InstantMessageLogFolder
 * Restored initializing logic of InstantMessageLogPath value from 1.23 to share setting between viewers.
 * Restored unused in 2.0 "LogChatTimestamp" and "LogChatIM" settings to avoid removing of them in 2.0
 * Restored default value of the "Save local chat log" setting from 1.23 & replaced with 2.0 own setting (LogNearbyChat was: LogChat)

Reviewed by Igor Borovkov & Kent Quirk at https://codereview.productengine.com/secondlife/r/193/
(transplanted from 43297b92c1bb7487dab6610bea61acac4c355878)
parent 4e76ec36
No related branches found
No related tags found
No related merge requests found
...@@ -22,17 +22,6 @@ ...@@ -22,17 +22,6 @@
<key>Value</key> <key>Value</key>
<string>|TOKEN COPY BusyModeResponse|</string> <string>|TOKEN COPY BusyModeResponse|</string>
</map> </map>
<key>InstantMessageLogFolder</key>
<map>
<key>Comment</key>
<string>Top level folder to your log files.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string />
</map>
<key>InstantMessageLogPath</key> <key>InstantMessageLogPath</key>
<map> <map>
<key>Comment</key> <key>Comment</key>
...@@ -55,10 +44,10 @@ ...@@ -55,10 +44,10 @@
<key>Value</key> <key>Value</key>
<integer>0</integer> <integer>0</integer>
</map> </map>
<key>LogChat</key> <key>LogNearbyChat</key>
<map> <map>
<key>Comment</key> <key>Comment</key>
<string>Log Chat</string> <string>Log Nearby Chat messages to a file. Is used instead of LogChat but with the "1" default value.</string>
<key>Persist</key> <key>Persist</key>
<integer>1</integer> <integer>1</integer>
<key>Type</key> <key>Type</key>
...@@ -110,5 +99,46 @@ ...@@ -110,5 +99,46 @@
<key>Value</key> <key>Value</key>
<integer>1</integer> <integer>1</integer>
</map> </map>
<!-- Settings below are for back compatibility only.
They are not used in current viewer anymore. But they can't be removed to avoid
influence on previous versions of the viewer in case of settings are not used or default value
should be changed. See EXT-6661. -->
<!-- 1.23 settings -->
<key>LogChat</key>
<map>
<key>Comment</key>
<string>Log Chat</string>
<key>Persist</key>
<integer>1</integer>
<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>LogChatTimestamp</key>
<map>
<key>Comment</key>
<string>Log Timestamp of Chat</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<!-- End of back compatibility settings -->
</map> </map>
</llsd> </llsd>
...@@ -1093,10 +1093,8 @@ void LLFloaterPreference::onClickLogPath() ...@@ -1093,10 +1093,8 @@ void LLFloaterPreference::onClickLogPath()
{ {
return; //Canceled! return; //Canceled!
} }
std::string chat_log_dir = picker.getDirName();
std::string chat_log_top_folder= gDirUtilp->getBaseFileName(chat_log_dir); gSavedPerAccountSettings.setString("InstantMessageLogPath", picker.getDirName());
gSavedPerAccountSettings.setString("InstantMessageLogPath",chat_log_dir);
gSavedPerAccountSettings.setString("InstantMessageLogFolder",chat_log_top_folder);
} }
void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email) void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email)
......
...@@ -207,7 +207,7 @@ void LLNearbyChat::addMessage(const LLChat& chat,bool archive,const LLSD &args) ...@@ -207,7 +207,7 @@ void LLNearbyChat::addMessage(const LLChat& chat,bool archive,const LLSD &args)
return; return;
} }
if (gSavedPerAccountSettings.getBOOL("LogChat")) if (gSavedPerAccountSettings.getBOOL("LogNearbyChat"))
{ {
LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText); LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText);
} }
......
...@@ -886,13 +886,12 @@ bool idle_startup() ...@@ -886,13 +886,12 @@ bool idle_startup()
} }
//Default the path if one isn't set. //Default the path if one isn't set.
if (gSavedPerAccountSettings.getString("InstantMessageLogFolder").empty()) // *NOTE: unable to check variable differ from "InstantMessageLogPath" because it was
// provided in pre 2.0 viewer. See EXT-6661
if (gSavedPerAccountSettings.getString("InstantMessageLogPath").empty())
{ {
gDirUtilp->setChatLogsDir(gDirUtilp->getOSUserAppDir()); gDirUtilp->setChatLogsDir(gDirUtilp->getOSUserAppDir());
std::string chat_log_dir = gDirUtilp->getChatLogsDir(); gSavedPerAccountSettings.setString("InstantMessageLogPath", gDirUtilp->getChatLogsDir());
std::string chat_log_top_folder=gDirUtilp->getBaseFileName(chat_log_dir);
gSavedPerAccountSettings.setString("InstantMessageLogPath",chat_log_dir);
gSavedPerAccountSettings.setString("InstantMessageLogFolder",chat_log_top_folder);
} }
else else
{ {
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
</text> </text>
<check_box <check_box
enabled="false" enabled="false"
control_name="LogChat" control_name="LogNearbyChat"
height="16" height="16"
label="Save nearby chat logs on my computer" label="Save nearby chat logs on my computer"
layout="topleft" layout="topleft"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment