diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-18 13:15:17 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-18 13:15:17 +0000 |
commit | 58c50b96dd38bf0427fa973cc27991e485550651 (patch) | |
tree | d42c3bbc91df1b60e695c49a446e41491406d58f /src/modules | |
parent | 08ed3a95b4f42079eea4d930af81257564b85b97 (diff) |
- returned back the old default settings for Chats/LogDirectory;
- %userid% is being added to a log path, if it doesn't end with \
git-svn-id: http://svn.miranda-ng.org/main/trunk@7718 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/chat/chat_opts.cpp | 2 | ||||
-rw-r--r-- | src/modules/chat/tools.cpp | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/modules/chat/chat_opts.cpp b/src/modules/chat/chat_opts.cpp index 1565f7efa6..eb6caf80e3 100644 --- a/src/modules/chat/chat_opts.cpp +++ b/src/modules/chat/chat_opts.cpp @@ -255,7 +255,7 @@ void LoadGlobalSettings(void) InitSetting(&g_Settings->pszOutgoingNick, "HeaderOutgoing", _T("%n:"));
InitSetting(&g_Settings->pszHighlightWords, "HighlightWords", _T("%m"));
- InitSetting(&g_Settings->pszLogDir, "LogDirectory", _T("%miranda_logpath%\\Chat"));
+ InitSetting(&g_Settings->pszLogDir, "LogDirectory", _T("%miranda_logpath%\\%proto%\\%userid%.log"));
g_Settings->LogIndentEnabled = (db_get_b(NULL, "Chat", "LogIndentEnabled", 1) != 0) ? TRUE : FALSE;
LOGFONT lf;
diff --git a/src/modules/chat/tools.cpp b/src/modules/chat/tools.cpp index c54341e8f3..384992b8f7 100644 --- a/src/modules/chat/tools.cpp +++ b/src/modules/chat/tools.cpp @@ -787,11 +787,18 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime) rva[10].lptzKey = NULL;
rva[10].lptzValue = NULL;
+ TCHAR tszTemp[MAX_PATH], *ptszVarPath;
+ if (g_Settings->pszLogDir[lstrlen(g_Settings->pszLogDir) - 1] == '\\') {
+ mir_sntprintf(tszTemp, SIZEOF(tszTemp), _T("%s%s"), g_Settings->pszLogDir, _T("%userid%.log"));
+ ptszVarPath = tszTemp;
+ }
+ else ptszVarPath = g_Settings->pszLogDir;
+
REPLACEVARSDATA dat = { sizeof(dat) };
dat.dwFlags = RVF_TCHAR;
dat.hContact = si->hContact;
dat.variables = rva;
- TCHAR *tszParsedName = (TCHAR*)CallService(MS_UTILS_REPLACEVARS, (WPARAM)g_Settings->pszLogDir, (LPARAM)&dat);
+ TCHAR *tszParsedName = (TCHAR*)CallService(MS_UTILS_REPLACEVARS, (WPARAM)ptszVarPath, (LPARAM)&dat);
PathToAbsoluteT(tszParsedName, si->pszLogFileName);
mir_free(tszParsedName);
|