From 0d11f71e3bb30c9760f7fc8b027897047530b136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Wed, 8 Oct 2014 08:55:53 +0000 Subject: SkypeClassic: Sync from leecher's repo (r1963) - Fixed a severe bug that prevented the correct auth user to be read preventing every authentication accept. - Fixed a crash in Groupchat when only 2 users were left and user parted the groupchat - Added feature for blocking contacts git-svn-id: http://svn.miranda-ng.org/main/trunk@10744 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeClassic/src/contacts.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'protocols/SkypeClassic/src/contacts.cpp') diff --git a/protocols/SkypeClassic/src/contacts.cpp b/protocols/SkypeClassic/src/contacts.cpp index 92b07eaab2..3c986d3826 100644 --- a/protocols/SkypeClassic/src/contacts.cpp +++ b/protocols/SkypeClassic/src/contacts.cpp @@ -21,7 +21,7 @@ extern BOOL bSkypeOut, bIsImoproxy; extern char protocol, g_szProtoName[]; // Handles -static HANDLE hMenuCallItem, hMenuCallHangup, hMenuSkypeOutCallItem, hMenuHoldCallItem, hMenuFileTransferItem, hMenuChatInitItem; +static HANDLE hMenuCallItem, hMenuCallHangup, hMenuSkypeOutCallItem, hMenuHoldCallItem, hMenuFileTransferItem, hMenuChatInitItem, hMenuBlockContactItem; // Check if alpha blending icons are supported // Seems to be not neccessary @@ -150,6 +150,19 @@ CLISTMENUITEM ChatInitItem(void) { return mi; } +CLISTMENUITEM BlockContactItem(void) { + CLISTMENUITEM mi = { 0 }; + + mi.cbSize = sizeof(mi); + mi.position = -2000005000; + mi.flags = CMIF_HIDDEN | CMIF_TCHAR; + mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_BLOCKCONTACT)); + mi.ptszName = LPGENT("Block contact"); + mi.pszContactOwner = SKYPE_PROTONAME; + mi.pszService = SKYPE_BLOCKCONTACT; + return mi; +} + HANDLE add_contextmenu(MCONTACT hContact) { CLISTMENUITEM mi; @@ -174,6 +187,8 @@ HANDLE add_contextmenu(MCONTACT hContact) { mi = ChatInitItem(); hMenuChatInitItem = Menu_AddContactMenuItem(&mi); + mi = BlockContactItem(); + hMenuBlockContactItem = Menu_AddContactMenuItem(&mi); ZeroMemory(&mi, sizeof(mi)); mi.cbSize = sizeof(mi); @@ -264,6 +279,12 @@ int __cdecl PrebuildContactMenu(WPARAM wParam, LPARAM lParam) { mi.flags ^= CMIF_HIDDEN; mi.flags |= CMIM_FLAGS; CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuChatInitItem, (LPARAM)&mi); + mi = BlockContactItem(); + mi.flags ^= CMIF_HIDDEN; + mi.flags |= CMIM_FLAGS | CMIM_NAME; + if (db_get_b((MCONTACT)wParam, SKYPE_PROTONAME, "IsBlocked", 0) == 1) + mi.ptszName = LPGENT("Unblock contact"); + CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuBlockContactItem, (LPARAM)&mi); } } -- cgit v1.2.3