summaryrefslogtreecommitdiff
path: root/init.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2010-08-18 08:26:47 +0300
committerGluzskiy Alexandr <sss123next@list.ru>2010-08-18 08:26:47 +0300
commit45ff7b504d79072bfbd24cf12f5818ed356f94bc (patch)
treeb3e51aa789863f95d48d5e3775216fa336911c9d /init.cpp
parente07a374f12258c3798c9f49ea926db29f90d93ec (diff)
modified: gpg_wrapper.cpp
modified: init.cpp modified: main.cpp modified: messages.cpp modified: new_gpg.rc modified: new_gpg.sln modified: new_gpg.vcproj modified: options.cpp modified: resource.h modified: utilities.cpp
Diffstat (limited to 'init.cpp')
-rw-r--r--init.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/init.cpp b/init.cpp
index 97d1db1..3351c1f 100644
--- a/init.cpp
+++ b/init.cpp
@@ -17,7 +17,7 @@
#include "commonheaders.h"
//global variables
-bool bAppendTags = false;
+bool bAppendTags = false, bDebugLog = false;
TCHAR *inopentag = NULL, *inclosetag = NULL, *outopentag = NULL, *outclosetag = NULL, *password = NULL;
list <JabberAccount*> Accounts;
@@ -30,6 +30,7 @@ extern char *date();
MM_INTERFACE mmi = {0};
UTF8_INTERFACE utfi = {0};
XML_API xi = {0};
+fstream debuglog;
#define MIID_GPG { 0x4227c050, 0x8d97, 0x48d2, { 0x91, 0xec, 0x6a, 0x95, 0x2b, 0x3d, 0xab, 0x94 } }
@@ -84,6 +85,13 @@ void init_vars()
inclosetag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szInCloseTag", _T("</GnuPGdec>"));
outopentag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szOutOpenTag", _T("<GPGenc>"));
outclosetag = UniGetContactSettingUtf(NULL, szGPGModuleName, "szOutCloseTag", _T("</GnuPgenc>"));
+ bDebugLog = DBGetContactSettingByte(NULL, szGPGModuleName, "bDebugLog", 0);
+ if(bDebugLog)
+ {
+ TCHAR *tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szLogFilePath", _T("C:\\gpglog.txt"));
+ debuglog.open(tmp, std::ios::app |std::ios::ate |std::ios::binary);
+// mir_free(tmp);
+ }
}
extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
@@ -187,5 +195,7 @@ extern "C" int __declspec(dllexport) Unload(void)
mir_free(outclosetag);
if(password)
delete [] password;
+ if(debuglog.is_open())
+ debuglog.close();
return 0;
}