summaryrefslogtreecommitdiff
path: root/plugins/StopSpamMod/src/utilities.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-05-18 18:14:20 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-05-18 18:14:20 +0000
commitd259b413d0812e0181b91846a922a4ddc44aca47 (patch)
treeb417e384f8a03ac14c497327bf5ef9d1713ce17c /plugins/StopSpamMod/src/utilities.cpp
parent1e5e6e5b820861d32cddb5602e4b64c93f1b4ded (diff)
changed path for stopspam_mod.log
git-svn-id: http://svn.miranda-ng.org/main/trunk@4720 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/StopSpamMod/src/utilities.cpp')
-rwxr-xr-xplugins/StopSpamMod/src/utilities.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp
index c61b47f2d2..647293687a 100755
--- a/plugins/StopSpamMod/src/utilities.cpp
+++ b/plugins/StopSpamMod/src/utilities.cpp
@@ -255,18 +255,17 @@ void LogSpamToFile(HANDLE hContact, tstring message)
if (!gbLogToFile) return;
tstring LogStrW, LogTime, LogProtocol, LogContactId, LogContactName;
- std::string filename;
+ tstring filename;
std::fstream file;
+ TCHAR pszName[MAX_PATH];
- UINT cbName=255;
- char* pszName = (char *)mir_alloc(cbName);
- extern HANDLE hStopSpamLogDirH;
+ if (hStopSpamLogDirH)
+ FoldersGetCustomPathT(hStopSpamLogDirH, pszName, MAX_PATH, _T(""));
+ else
+ lstrcpyn(pszName, VARST( _T("%miranda_logpath%")), SIZEOF(pszName));
- if (FoldersGetCustomPath(hStopSpamLogDirH, pszName, cbName, ""))
- CallService(MS_DB_GETPROFILEPATH,(WPARAM) cbName, (LPARAM)pszName);
- filename=pszName;
- filename=filename+"\\stopspam_mod.log";
- mir_free(pszName);
+ filename = pszName;
+ filename = filename + _T("\\stopspam_mod.log");
file.open(filename.c_str(),std::ios::out |std::ios::app);
@@ -275,7 +274,7 @@ void LogSpamToFile(HANDLE hContact, tstring message)
tm *TimeNow;
time(&time_now);
TimeNow = localtime(&time_now);
- LogTime=_wasctime( TimeNow );
+ LogTime=_wasctime( TimeNow );
// Time Log line
// Name, UID and Protocol Log line