From 072e6741acb7323279beaf516107a5d09d91cf09 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Mon, 28 May 2012 02:54:36 +0300 Subject: keys export //TODO: keys import --- init.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'init.cpp') diff --git a/init.cpp b/init.cpp index 49f372a..5388f0f 100755 --- a/init.cpp +++ b/init.cpp @@ -23,7 +23,7 @@ TCHAR *inopentag = NULL, *inclosetag = NULL, *outopentag = NULL, *outclosetag = list Accounts; HINSTANCE hInst; -HANDLE hLoadPubKey = NULL, hToggleEncryption = NULL, hOnPreBuildContactMenu = NULL, hSendKey = NULL, g_hCLIcon = NULL; +HANDLE hLoadPubKey = NULL, hToggleEncryption = NULL, hOnPreBuildContactMenu = NULL, hSendKey = NULL, g_hCLIcon = NULL, hExportGpgKeys = NULL, hImportGpgKeys = NULL; PLUGINLINK *pluginLink; IconExtraColumn g_IEC = {0}; static int OnModulesLoaded(WPARAM wParam,LPARAM lParam); @@ -81,6 +81,8 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) int LoadKey(WPARAM w, LPARAM l); int ToggleEncryption(WPARAM w, LPARAM l); int SendKey(WPARAM w, LPARAM l); +int ExportGpGKeys(WPARAM w, LPARAM l); +int ImportGpGKeys(WPARAM w, LPARAM l); void init_vars() { @@ -124,6 +126,8 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) CreateServiceFunction("/LoadPubKey",(MIRANDASERVICE)LoadKey); CreateServiceFunction("/ToggleEncryption",(MIRANDASERVICE)ToggleEncryption); CreateServiceFunction("/SendKey",(MIRANDASERVICE)SendKey); + CreateServiceFunction("/ExportGPGKeys",(MIRANDASERVICE)ExportGpGKeys); + CreateServiceFunction("/ImportGPGKeys",(MIRANDASERVICE)ImportGpGKeys); CLISTMENUITEM mi = {0}; mi.cbSize=sizeof(mi); mi.position=-0x7FFFFFFF; @@ -148,6 +152,23 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) mi.pszName="Send public key"; mi.pszService="/SendKey"; hSendKey = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM,0,(LPARAM)&mi); + ZeroMemory(&mi,sizeof(mi)); + mi.cbSize=sizeof(mi); + mi.position=-0x7FFFFFFF; + mi.flags=0; + mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); + mi.pszName="Export GPG Public keys from all users"; + mi.pszService="/ExportGPGKeys"; + hExportGpgKeys = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi); + ZeroMemory(&mi,sizeof(mi)); + mi.cbSize=sizeof(mi); + mi.position=-0x7FFFFFFF; + mi.flags=0; + mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); + mi.pszName="Import GPG Public keys from all users"; + mi.pszService="/ImportGPGKeys"; + hImportGpgKeys = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi); + return 0; } -- cgit v1.2.3