diff options
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);
}
}
|