summaryrefslogtreecommitdiff
path: root/protocols/GTalkExt/src/menu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/GTalkExt/src/menu.cpp')
-rw-r--r--protocols/GTalkExt/src/menu.cpp59
1 files changed, 8 insertions, 51 deletions
diff --git a/protocols/GTalkExt/src/menu.cpp b/protocols/GTalkExt/src/menu.cpp
index 23e571c206..377b776091 100644
--- a/protocols/GTalkExt/src/menu.cpp
+++ b/protocols/GTalkExt/src/menu.cpp
@@ -20,7 +20,6 @@
//***************************************************************************************
#include "stdafx.h"
-#include "menu.h"
#include "resources.h"
#include "options.h"
#include "inbox.h"
@@ -28,66 +27,24 @@
static const LPSTR MS_GTALKEXT_OPENMAILBOX = SHORT_PLUGIN_NAME "/OpenMailbox";
static const LPTSTR _T(OPEN_MAILBOX_ITEM_CAPTION) = LPGENT("Open mailbox");
-HANDLE hOpenMailboxService = 0;
-HANDLE hOpenMailboxMenuItem = 0;
+extern HICON g_hPopupIcon;
+
HANDLE hOnPrebuildMenu = 0;
INT_PTR OpenMailboxMenuHandler(WPARAM wParam, LPARAM lParam)
{
- if (db_get_b((HANDLE)wParam, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0))
- OpenContactInbox((HANDLE)wParam);
- return 0;
-}
-
-int OnPrebuildMenu(WPARAM wParam, LPARAM lParam)
-{
- CLISTMENUITEM cmi = { sizeof(cmi) };
- cmi.flags = CMIM_FLAGS;
- if (!db_get_b((HANDLE)wParam, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0))
- cmi.flags |= CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hOpenMailboxMenuItem, (LPARAM)&cmi);
+ OpenContactInbox((HANDLE)wParam);
return 0;
}
-BOOL InitMenus(BOOL init)
+void InitMenus()
{
- if (init) {
- hOpenMailboxService = (HANDLE)CreateServiceFunction(MS_GTALKEXT_OPENMAILBOX, OpenMailboxMenuHandler);
- if (!hOpenMailboxService) {
- InitMenus(FALSE);
- return FALSE;
- }
-
- extern HICON g_hPopupIcon;
-
+ CreateServiceFunction(MS_GTALKEXT_OPENMAILBOX, OpenMailboxMenuHandler);
+/*!!!!!!!!!!!!!!!!!!!!!
CLISTMENUITEM cmi = { sizeof(cmi) };
cmi.flags = CMIF_TCHAR;
cmi.hIcon = g_hPopupIcon;
cmi.ptszName = _T(OPEN_MAILBOX_ITEM_CAPTION);
cmi.pszService = MS_GTALKEXT_OPENMAILBOX;
- hOpenMailboxMenuItem = Menu_AddContactMenuItem(&cmi);
-
- if (!hOpenMailboxMenuItem) {
- InitMenus(FALSE);
- return FALSE;
- }
-
- hOnPrebuildMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, OnPrebuildMenu);
- if (!hOnPrebuildMenu) {
- InitMenus(FALSE);
- return FALSE;
- }
- }
- else {
- if (hOnPrebuildMenu) {
- UnhookEvent(hOnPrebuildMenu);
- hOnPrebuildMenu = 0;
- }
- if (hOpenMailboxService) {
- DestroyServiceFunction(hOpenMailboxService);
- hOpenMailboxService = 0;
- }
- }
-
- return TRUE;
-} \ No newline at end of file
+ Menu_AddContactMenuItem(&cmi); */
+}