From d15bd517fb0eb4bbdb1b118b44398b00bc8f6d6a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 9 Feb 2018 16:13:50 +0300 Subject: all duplicate "Request auth", "Grant auth" & "Revoke auth" menu items eliminated --- protocols/JabberG/src/jabber_menu.cpp | 47 +--------------------------------- protocols/JabberG/src/jabber_proto.cpp | 4 +++ protocols/JabberG/src/jabber_proto.h | 2 +- 3 files changed, 6 insertions(+), 47 deletions(-) (limited to 'protocols/JabberG') diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index d39685912b..35d24eb16d 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -88,24 +88,6 @@ static CJabberProto* JabberGetInstanceByHContact(MCONTACT hContact) return nullptr; } -static INT_PTR JabberMenuHandleRequestAuth(WPARAM wParam, LPARAM lParam) -{ - CJabberProto *ppro = JabberGetInstanceByHContact(wParam); - return(ppro) ? ppro->OnMenuHandleRequestAuth(wParam, lParam) : 0; -} - -static INT_PTR JabberMenuHandleGrantAuth(WPARAM wParam, LPARAM lParam) -{ - CJabberProto *ppro = JabberGetInstanceByHContact(wParam); - return(ppro) ? ppro->OnMenuHandleGrantAuth(wParam, lParam) : 0; -} - -static INT_PTR JabberMenuRevokeAuth(WPARAM wParam, LPARAM lParam) -{ - CJabberProto *ppro = JabberGetInstanceByHContact(wParam); - return(ppro) ? ppro->OnMenuRevokeAuth(wParam, lParam) : 0; -} - static INT_PTR JabberMenuConvertChatContact(WPARAM wParam, LPARAM lParam) { CJabberProto *ppro = JabberGetInstanceByHContact(wParam); @@ -202,33 +184,6 @@ void g_MenuInit(void) CMenuItem mi; mi.flags = CMIF_UNMOVABLE; - // "Request authorization" - SET_UID(mi, 0x36375a1f, 0xc142, 0x4d6e, 0xa6, 0x57, 0xe4, 0x76, 0x5d, 0xbc, 0x59, 0x8e); - mi.name.a = LPGEN("Request authorization"); - mi.position = -2000001000; - mi.hIcolibItem = Skin_GetIconHandle(SKINICON_AUTH_REQUEST); - mi.pszService = "Jabber/ReqAuth"; - g_hMenuRequestAuth = Menu_AddContactMenuItem(&mi); - CreateServiceFunction(mi.pszService, JabberMenuHandleRequestAuth); - - // "Grant authorization" - SET_UID(mi, 0x4c90452a, 0x869a, 0x4a81, 0xaf, 0xa8, 0x28, 0x34, 0xaf, 0x2b, 0x6b, 0x30); - mi.pszService = "Jabber/GrantAuth"; - mi.name.a = LPGEN("Grant authorization"); - mi.position = -2000001001; - mi.hIcolibItem = Skin_GetIconHandle(SKINICON_AUTH_GRANT); - g_hMenuGrantAuth = Menu_AddContactMenuItem(&mi); - CreateServiceFunction(mi.pszService, JabberMenuHandleGrantAuth); - - // Revoke auth - SET_UID(mi, 0x619efdcb, 0x99c0, 0x44a8, 0xbf, 0x28, 0xc3, 0xe0, 0x2f, 0xb3, 0x7e, 0x77); - mi.pszService = "Jabber/RevokeAuth"; - mi.name.a = LPGEN("Revoke authorization"); - mi.position = -2000001002; - mi.hIcolibItem = Skin_GetIconHandle(SKINICON_AUTH_REVOKE); - g_hMenuRevokeAuth = Menu_AddContactMenuItem(&mi); - CreateServiceFunction(mi.pszService, JabberMenuRevokeAuth); - // "Convert Chat/Contact" SET_UID(mi, 0xa98894ec, 0xbaa6, 0x4e1e, 0x8d, 0x75, 0x72, 0xc, 0xae, 0x25, 0xd8, 0x87); mi.pszService = "Jabber/ConvertChatContact"; @@ -535,7 +490,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleGrantAuth(WPARAM hContact, LPARAM) return 0; } -INT_PTR __cdecl CJabberProto::OnMenuRevokeAuth(WPARAM hContact, LPARAM) +INT_PTR __cdecl CJabberProto::OnMenuHandleRevokeAuth(WPARAM hContact, LPARAM) { if (hContact != 0 && m_bJabberOnline) { ptrW jid(getWStringA(hContact, "jid")); diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index a360260186..38e378b18c 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -105,6 +105,10 @@ CJabberProto::CJabberProto(const char *aProtoName, const wchar_t *aUserName) : CreateProtoService(PS_SETMYAVATAR, &CJabberProto::JabberSetAvatar); CreateProtoService(PS_SETMYNICKNAME, &CJabberProto::JabberSetNickname); + CreateProtoService(PS_MENU_REQAUTH, &CJabberProto::OnMenuHandleRequestAuth); + CreateProtoService(PS_MENU_GRANTAUTH, &CJabberProto::OnMenuHandleGrantAuth); + CreateProtoService(PS_MENU_REVOKEAUTH, &CJabberProto::OnMenuHandleRevokeAuth); + CreateProtoService(JS_DB_GETEVENTTEXT_CHATSTATES, &CJabberProto::OnGetEventTextChatStates); CreateProtoService(JS_DB_GETEVENTTEXT_PRESENCE, &CJabberProto::OnGetEventTextPresence); diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index 350b5e438c..718a788e1f 100755 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -562,7 +562,7 @@ struct CJabberProto : public PROTO, public IJabberInterface INT_PTR __cdecl OnMenuTransportLogin(WPARAM wParam, LPARAM lParam); INT_PTR __cdecl OnMenuTransportResolve(WPARAM wParam, LPARAM lParam); INT_PTR __cdecl OnMenuBookmarkAdd(WPARAM wParam, LPARAM lParam); - INT_PTR __cdecl OnMenuRevokeAuth(WPARAM wParam, LPARAM lParam); + INT_PTR __cdecl OnMenuHandleRevokeAuth(WPARAM wParam, LPARAM lParam); INT_PTR __cdecl OnMenuHandleResource(WPARAM wParam, LPARAM lParam, LPARAM res); INT_PTR __cdecl OnMenuHandleDirectPresence(WPARAM wParam, LPARAM lParam, LPARAM res); INT_PTR __cdecl OnMenuSetPriority(WPARAM wParam, LPARAM lParam, LPARAM dwDelta); -- cgit v1.2.3