From 8280bdbb5b6fb83a2d1b4ce5276cb77e437a4447 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sun, 8 Aug 2010 16:08:56 +0300 Subject: modified: init.cpp modified: utilities.cpp --- init.cpp | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) (limited to 'init.cpp') diff --git a/init.cpp b/init.cpp index ea509cb..a36db70 100644 --- a/init.cpp +++ b/init.cpp @@ -18,7 +18,7 @@ HINSTANCE hInst; -static HANDLE hLoadPubKey; +HANDLE hLoadPubKey = NULL, hToggleEncryption = NULL, hOnPreBuildContactMenu = NULL; PLUGINLINK *pluginLink; static int OnModulesLoaded(WPARAM wParam,LPARAM lParam); extern char *date(); @@ -93,16 +93,18 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); mi.pszName="Toggle GPG encryption"; mi.pszService="/ToggleEncryption"; - hLoadPubKey = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi); + hToggleEncryption = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi); return 0; } -int GpgOptInit(WPARAM wParam,LPARAM lParam); -int gpg_init(); static int OnModulesLoaded(WPARAM wParam,LPARAM lParam) { + int GpgOptInit(WPARAM wParam,LPARAM lParam); + int gpg_init(); + int OnPreBuildContactMenu(WPARAM w, LPARAM l); HookEvent(ME_OPT_INITIALISE, GpgOptInit); + hOnPreBuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, OnPreBuildContactMenu); gpg_init(); return 0; } @@ -112,22 +114,3 @@ extern "C" int __declspec(dllexport) Unload(void) { return 0; } - -void ShowLoadPublicKeyDialog(); - -int LoadKey(WPARAM w, LPARAM l) -{ - extern std::map user_data; - extern int item_num; - item_num = 0; //black magic here - user_data[1] = (HANDLE)w; - ShowLoadPublicKeyDialog(); -// MessageBox(0, _T("Load GPG key function called"), _T("INFO"), MB_OK); - return 0; -} -int ToggleEncryption(WPARAM w, LPARAM l) -{ - HANDLE hContact = (HANDLE)w; - MessageBox(0, _T("Toggle GPG encryption function called"), _T("INFO"), MB_OK); - return 0; -} \ No newline at end of file -- cgit v1.2.3