diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-10-08 08:55:53 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-10-08 08:55:53 +0000 |
commit | 0d11f71e3bb30c9760f7fc8b027897047530b136 (patch) | |
tree | f65324ac5278878e1bad871dd083b1c972590c38 /protocols/SkypeClassic/src/contacts.cpp | |
parent | a134f7e823d5d334bfee65652534c206569e0b3e (diff) |
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
Diffstat (limited to 'protocols/SkypeClassic/src/contacts.cpp')
-rw-r--r-- | protocols/SkypeClassic/src/contacts.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
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);
}
}
|