diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-10-24 19:30:48 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-10-24 19:30:48 +0000 |
commit | e98b0138c61701470f2ce98c96ecadab9d4ed301 (patch) | |
tree | 34745dd8ffb21e403e8e375df13e44dea7576e08 /protocols | |
parent | 38ce5b30b86aa7ae479713426d7a5a4f6fb0f619 (diff) |
auth items shows with ctrl
git-svn-id: http://svn.miranda-ng.org/main/trunk@2067 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/Skype/src/skype_menus.cpp | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/protocols/Skype/src/skype_menus.cpp b/protocols/Skype/src/skype_menus.cpp index 58a6b603bc..8cd8fa3bf3 100644 --- a/protocols/Skype/src/skype_menus.cpp +++ b/protocols/Skype/src/skype_menus.cpp @@ -13,6 +13,17 @@ INT_PTR CSkypeProto::MenuChooseService(WPARAM wParam, LPARAM lParam) return 0;
}
+static void sttEnableMenuItem(HANDLE hMenuItem, BOOL bEnable)
+{
+ CLISTMENUITEM clmi = {0};
+ clmi.cbSize = sizeof(CLISTMENUITEM);
+ clmi.flags = CMIM_FLAGS;
+ if (!bEnable)
+ clmi.flags |= CMIF_HIDDEN;
+
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItem, (LPARAM)&clmi);
+}
+
int CSkypeProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
{
HANDLE hContact = (HANDLE)wParam;
@@ -20,6 +31,17 @@ int CSkypeProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) if (hContact == NULL)
return 0;
+ if (this->IsOnline() && !DBGetContactSettingByte(hContact, m_szModuleName, "ChatRoom", 0))
+ {
+ bool ctrlPressed = (GetKeyState(VK_CONTROL) & 0x8000) != 0;
+
+ //BYTE type = DBGetContactSettingByte(hContact, m_szModuleName, FACEBOOK_KEY_CONTACT_TYPE, 0);
+
+ sttEnableMenuItem( g_hContactMenuItems[CMI_AUTH_REQUEST], ctrlPressed /*|| type == FACEBOOK_CONTACT_NONE || !type */);
+ sttEnableMenuItem( g_hContactMenuItems[CMI_AUTH_GRANT], ctrlPressed /*|| type == FACEBOOK_CONTACT_APPROVE */);
+ sttEnableMenuItem( g_hContactMenuItems[CMI_AUTH_REVOKE], ctrlPressed /*|| type == FACEBOOK_CONTACT_FRIEND */);
+ }
+
return 0;
}
@@ -84,31 +106,12 @@ int CSkypeProto::RevokeAuth(WPARAM wParam, LPARAM lParam) return 0;
}
-static void sttEnableMenuItem(HANDLE hMenuItem, BOOL bEnable)
-{
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof(CLISTMENUITEM);
- clmi.flags = CMIM_FLAGS;
- if (!bEnable)
- clmi.flags |= CMIF_HIDDEN;
-
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItem, (LPARAM)&clmi);
-}
-
int CSkypeProto::PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
- sttEnableMenuItem( g_hContactMenuItems[CMI_AUTH_REQUEST], FALSE );
- sttEnableMenuItem( g_hContactMenuItems[CMI_AUTH_GRANT], FALSE );
- sttEnableMenuItem( g_hContactMenuItems[CMI_AUTH_REVOKE], FALSE );
- /*sttEnableMenuItem( g_hMenuCommands, FALSE );
- sttEnableMenuItem( g_hMenuSendNote, FALSE );
- sttEnableMenuItem( g_hMenuConvert, FALSE );
- sttEnableMenuItem( g_hMenuRosterAdd, FALSE );
- sttEnableMenuItem( g_hMenuLogin, FALSE );
- sttEnableMenuItem( g_hMenuRefresh, FALSE );
- sttEnableMenuItem( g_hMenuAddBookmark, FALSE );
- sttEnableMenuItem( g_hMenuResourcesRoot, FALSE );
- sttEnableMenuItem( g_hMenuDirectPresence[0], FALSE );*/
+ for (size_t i=0; i<SIZEOF(g_hContactMenuItems); i++)
+ {
+ sttEnableMenuItem(g_hContactMenuItems[i], false);
+ }
CSkypeProto* ppro = CSkypeProto::GetInstanceByHContact((HANDLE)wParam);
return (ppro) ? ppro->OnPrebuildContactMenu(wParam, lParam) : 0;
@@ -136,7 +139,7 @@ void CSkypeProto::InitMenus() mi.ptszName = LPGENT("Request authorization");
mi.flags = CMIF_ICONFROMICOLIB | CMIF_TCHAR;
mi.position = -2000001000;
- mi.icolibItem = CSkypeProto::GetIconHandle("authReuest");
+ mi.icolibItem = CSkypeProto::GetIconHandle("authRequest");
mi.pszService = "Skype/ReqAuth";
g_hContactMenuItems[CMI_AUTH_REQUEST] = Menu_AddContactMenuItem(&mi);
g_hContactMenuSvc[CMI_AUTH_REQUEST] = CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::RequestAuth>);
|