summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-02-09 16:13:50 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-02-09 16:13:50 +0300
commitd15bd517fb0eb4bbdb1b118b44398b00bc8f6d6a (patch)
treeead9ec16a070ed6237975fe00a368fec2491e1ad /protocols/SkypeWeb/src
parentb407cbb7ad5cf00f0420fd91b82969ffcbaba5b5 (diff)
all duplicate "Request auth", "Grant auth" & "Revoke auth" menu items eliminated
Diffstat (limited to 'protocols/SkypeWeb/src')
-rw-r--r--protocols/SkypeWeb/src/skype_menus.cpp23
-rw-r--r--protocols/SkypeWeb/src/skype_menus.h2
-rw-r--r--protocols/SkypeWeb/src/skype_proto.cpp3
3 files changed, 6 insertions, 22 deletions
diff --git a/protocols/SkypeWeb/src/skype_menus.cpp b/protocols/SkypeWeb/src/skype_menus.cpp
index bcf3f98315..55c4a4288f 100644
--- a/protocols/SkypeWeb/src/skype_menus.cpp
+++ b/protocols/SkypeWeb/src/skype_menus.cpp
@@ -35,8 +35,9 @@ int CSkypeProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
bool isGrantNeed = getByte(hContact, "Grant", 0) > 0;
bool isBlocked = getBool(hContact, "IsBlocked", false);
- Menu_ShowItem(ContactMenuItems[CMI_AUTH_REQUEST], isCtrlPressed || isAuthNeed);
- Menu_ShowItem(ContactMenuItems[CMI_AUTH_GRANT], isCtrlPressed || isGrantNeed);
+ Menu_ShowItem(m_hmiReqAuth, isCtrlPressed || isAuthNeed);
+ Menu_ShowItem(m_hmiGrantAuth, isCtrlPressed || isGrantNeed);
+
Menu_ShowItem(ContactMenuItems[CMI_BLOCK], true);
Menu_ShowItem(ContactMenuItems[CMI_UNBLOCK], isCtrlPressed || isBlocked);
Menu_ShowItem(ContactMenuItems[CMI_GETSERVERHISTORY], true);
@@ -60,24 +61,6 @@ void CSkypeProto::InitMenus()
CMenuItem mi;
mi.flags = CMIF_UNICODE;
- // Request authorization
- mi.pszService = MODULE"/RequestAuth";
- mi.name.w = LPGENW("Request authorization");
- mi.position = CMI_POSITION + CMI_AUTH_REQUEST;
- mi.hIcolibItem = ::Skin_GetIconHandle(SKINICON_AUTH_REQUEST);
- SET_UID(mi, 0x36375a1f, 0xc142, 0x4d6e, 0xa6, 0x57, 0xe4, 0x76, 0x5d, 0xbc, 0x59, 0x8e);
- ContactMenuItems[CMI_AUTH_REQUEST] = Menu_AddContactMenuItem(&mi);
- CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::OnRequestAuth>);
-
- // Grant authorization
- mi.pszService = MODULE"/GrantAuth";
- mi.name.w = LPGENW("Grant authorization");
- mi.position = CMI_POSITION + CMI_AUTH_GRANT;
- mi.hIcolibItem = ::Skin_GetIconHandle(SKINICON_AUTH_GRANT);
- SET_UID(mi, 0x4c90452a, 0x869a, 0x4a81, 0xaf, 0xa8, 0x28, 0x34, 0xaf, 0x2b, 0x6b, 0x30);
- ContactMenuItems[CMI_AUTH_GRANT] = Menu_AddContactMenuItem(&mi);
- CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::OnGrantAuth>);
-
mi.pszService = MODULE"/GetHistory";
mi.name.w = LPGENW("Get server history");
mi.position = CMI_POSITION + CMI_GETSERVERHISTORY;
diff --git a/protocols/SkypeWeb/src/skype_menus.h b/protocols/SkypeWeb/src/skype_menus.h
index 675be24f1d..6dbb857699 100644
--- a/protocols/SkypeWeb/src/skype_menus.h
+++ b/protocols/SkypeWeb/src/skype_menus.h
@@ -22,8 +22,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
enum
{
- CMI_AUTH_REQUEST,
- CMI_AUTH_GRANT,
CMI_GETSERVERHISTORY,
CMI_BLOCK,
CMI_UNBLOCK,
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp
index d43e3cb012..3b665b3f0a 100644
--- a/protocols/SkypeWeb/src/skype_proto.cpp
+++ b/protocols/SkypeWeb/src/skype_proto.cpp
@@ -39,6 +39,9 @@ CSkypeProto::CSkypeProto(const char* protoName, const wchar_t* userName) :
CreateProtoService(PS_GETMYAVATAR, &CSkypeProto::SvcGetMyAvatar);
CreateProtoService(PS_SETMYAVATAR, &CSkypeProto::SvcSetMyAvatar);
+ CreateProtoService(PS_MENU_REQAUTH, &CSkypeProto::OnRequestAuth);
+ CreateProtoService(PS_MENU_GRANTAUTH, &CSkypeProto::OnGrantAuth);
+
CreateProtoService("/IncomingCallCLE", &CSkypeProto::OnIncomingCallCLE);
CreateProtoService("/IncomingCallPP", &CSkypeProto::OnIncomingCallPP);