From ea8554407ed4038aca0eb7835f9d813bdf37c1a9 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sat, 14 Aug 2010 03:50:31 +0300 Subject: fixes .... mainly --- init.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'init.cpp') diff --git a/init.cpp b/init.cpp index 801b1c7..86b189f 100644 --- a/init.cpp +++ b/init.cpp @@ -16,6 +16,9 @@ #include "commonheaders.h" +//global variables +bool bAppendTags = false; +TCHAR *inopentag, *inclosetag, *outopentag, *outclosetag; HINSTANCE hInst; HANDLE hLoadPubKey = NULL, hToggleEncryption = NULL, hOnPreBuildContactMenu = NULL, hSendKey = NULL; @@ -31,7 +34,7 @@ UTF8_INTERFACE utfi = {0}; PLUGININFOEX pluginInfo={ sizeof(PLUGININFOEX), 0, - PLUGIN_MAKE_VERSION(0,0,0,1), + PLUGIN_MAKE_VERSION(0,0,0,2), "new GPG encryption support plugin, used code from http://addons.miranda-im.org/details.php?action=viewfile&id=3485", "sss", "sss123next@list.ru", @@ -71,9 +74,19 @@ int LoadKey(WPARAM w, LPARAM l); int ToggleEncryption(WPARAM w, LPARAM l); int SendKey(WPARAM w, LPARAM l); +void init_vars() +{ + bAppendTags = DBGetContactSettingByte(NULL, szModuleName, "bAppendTags", 0); + inopentag = UniGetContactSettingUtf(NULL, szModuleName, "szInOpenTag", _T("")); + inclosetag = UniGetContactSettingUtf(NULL, szModuleName, "szInCloseTag", _T("")); + outopentag = UniGetContactSettingUtf(NULL, szModuleName, "szOutOpenTag", _T("")); + outclosetag = UniGetContactSettingUtf(NULL, szModuleName, "szOutCloseTag", _T("")); +} + extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) { pluginLink=link; + init_vars(); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); mir_getMMI(&mmi); mir_getUTFI(&utfi); @@ -121,15 +134,17 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam) int OnPreBuildContactMenu(WPARAM w, LPARAM l); int RecvMsgSvc(WPARAM w, LPARAM l); int SendMsgSvc(WPARAM w, LPARAM l); + int HookSendMsg(WPARAM w, LPARAM l); - void test(); +// void test(); void FirstRun(); FirstRun(); - test(); +// test(); HookEvent(ME_OPT_INITIALISE, GpgOptInit); + HookEvent(ME_DB_EVENT_FILTER_ADD, HookSendMsg); hOnPreBuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, OnPreBuildContactMenu); PROTOCOLDESCRIPTOR pd = {0}; @@ -157,5 +172,9 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam) extern "C" int __declspec(dllexport) Unload(void) { + mir_free(inopentag); + mir_free(inclosetag); + mir_free(outopentag); + mir_free(outclosetag); return 0; } -- cgit v1.2.3