From d259b413d0812e0181b91846a922a4ddc44aca47 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 18 May 2013 18:14:20 +0000 Subject: changed path for stopspam_mod.log git-svn-id: http://svn.miranda-ng.org/main/trunk@4720 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/StopSpamMod/src/utilities.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'plugins/StopSpamMod/src/utilities.cpp') 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 -- cgit v1.2.3