summaryrefslogtreecommitdiff
path: root/init.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'init.cpp')
-rw-r--r--init.cpp29
1 files changed, 6 insertions, 23 deletions
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<int, HANDLE> 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