From e84bafdd3f3d2eb67e10a9bd3fbe600748962b6f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 24 Mar 2017 15:38:17 +0300 Subject: revolution in chat menus - common code moved to the core (Chat_CreateGCMenu, Chat_DestroyGCMenu); - ability added to any plugin to add its own items into any GC menu, not only to the protocol plugins to do that a plugin calls Chat_AddMenuItems and returns 0 to allow any other plugin to process menu hook --- protocols/WhatsApp/src/chat.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'protocols/WhatsApp/src/chat.cpp') diff --git a/protocols/WhatsApp/src/chat.cpp b/protocols/WhatsApp/src/chat.cpp index a87be6a24f..38f4878f7d 100644 --- a/protocols/WhatsApp/src/chat.cpp +++ b/protocols/WhatsApp/src/chat.cpp @@ -273,14 +273,10 @@ int WhatsAppProto::OnChatMenu(WPARAM, LPARAM lParam) if (mir_strcmpi(gcmi->pszModule, m_szModuleName)) return 0; - if (gcmi->Type == MENU_ON_LOG) { - gcmi->nItems = _countof(sttLogListItems); - gcmi->Item = sttLogListItems; - } - else if (gcmi->Type == MENU_ON_NICKLIST) { - gcmi->nItems = _countof(sttNickListItems); - gcmi->Item = sttNickListItems; - } + if (gcmi->Type == MENU_ON_LOG) + Chat_AddMenuItems(gcmi->hMenu, _countof(sttLogListItems), sttLogListItems); + else if (gcmi->Type == MENU_ON_NICKLIST) + Chat_AddMenuItems(gcmi->hMenu, _countof(sttNickListItems), sttNickListItems); return 0; } -- cgit v1.2.3