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/SkypeWeb/src/skype_chatrooms.cpp | 31 ++++++++++-------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'protocols/SkypeWeb') diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index 30f566e0fc..0d0f304798 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -635,33 +635,22 @@ int CSkypeProto::OnGroupChatMenuHook(WPARAM, LPARAM lParam) { LPGENW("&Leave chat session"), 20, MENU_ITEM, FALSE }, { LPGENW("&Change topic..."), 30, MENU_ITEM, FALSE } }; - gcmi->nItems = _countof(Items); - gcmi->Item = (gc_item*)Items; + Chat_AddMenuItems(gcmi->hMenu, _countof(Items), Items); } else if (gcmi->Type == MENU_ON_NICKLIST) { -/* if (IsMe(_T2A(gcmi->pszUID))) + static const struct gc_item Items[] = { - gcmi->nItems = 0; - gcmi->Item = NULL; - } - else - {*/ - static const struct gc_item Items[] = - { - { LPGENW("Kick &user"), 10, MENU_ITEM }, - { NULL, 0, MENU_SEPARATOR }, - { LPGENW("Set &role"), 20, MENU_NEWPOPUP }, - { LPGENW("&Admin"), 30, MENU_POPUPITEM }, - { LPGENW("&User"), 40, MENU_POPUPITEM }, - { LPGENW("Change nick..."), 50, MENU_ITEM }, - }; - gcmi->nItems = _countof(Items); - gcmi->Item = (gc_item*)Items; -// } + { LPGENW("Kick &user"), 10, MENU_ITEM }, + { NULL, 0, MENU_SEPARATOR }, + { LPGENW("Set &role"), 20, MENU_NEWPOPUP }, + { LPGENW("&Admin"), 30, MENU_POPUPITEM }, + { LPGENW("&User"), 40, MENU_POPUPITEM }, + { LPGENW("Change nick..."), 50, MENU_ITEM }, + }; + Chat_AddMenuItems(gcmi->hMenu, _countof(Items), Items); } - return 0; } -- cgit v1.2.3