summaryrefslogtreecommitdiff
path: root/plugins/KeyboardNotify
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-03-01 12:38:16 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-03-01 12:38:16 +0000
commiteac56f188d4c4bac1d61c0104f5840ed93d0b0a8 (patch)
tree6ee6165ae8504d67d8d068d2fc05e57d85b0f0a0 /plugins/KeyboardNotify
parent4a448e21071cbd943b437c713ee33a3c50bba319 (diff)
removing direct access to MC database variables
git-svn-id: http://svn.miranda-ng.org/main/trunk@8347 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/KeyboardNotify')
-rw-r--r--plugins/KeyboardNotify/src/main.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp
index 1ae8c20946..243042486f 100644
--- a/plugins/KeyboardNotify/src/main.cpp
+++ b/plugins/KeyboardNotify/src/main.cpp
@@ -122,28 +122,15 @@ static LRESULT CALLBACK MirandaKeyBoardHookFunction(int, WPARAM, LPARAM);
static LRESULT CALLBACK MirandaWndProcHookFunction(int, WPARAM, LPARAM);
BOOL CheckMsgWnd(MCONTACT, BOOL *);
-BOOL isMetaContactsSubContact(MCONTACT hMetaContact, MCONTACT hContact)
-{
- char *szProto = GetContactProto(hMetaContact);
- if (szProto && !strcmp(META_PROTO, szProto)) { // Safety check
- int i = db_get_dw(hContact, META_PROTO, "ContactNumber", -1);
- if (i >= 0 && hContact == (MCONTACT)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hMetaContact, i))
- return TRUE;
- }
- return FALSE;
-}
-
BOOL checkOpenWindow(MCONTACT hContact)
{
- BOOL found, focus;
-
if (bFlashIfMsgOpen && !bFlashIfMsgWinNotTop)
return TRUE;
- found = CheckMsgWnd(hContact, &focus);
+ BOOL focus, found = CheckMsgWnd(hContact, &focus);
if (!found && bMetaProtoEnabled) {
MCONTACT hMetaContact = (MCONTACT)db_get_dw(hContact, META_PROTO, "Handle", 0);
- if (hMetaContact && isMetaContactsSubContact(hMetaContact, hContact))
+ if (hMetaContact && db_mc_getMeta(hContact) == hMetaContact)
found = CheckMsgWnd(hMetaContact, &focus);
}
if (!found)
@@ -382,7 +369,7 @@ BOOL contactCheckProtocol(char *szProto, MCONTACT hContact, WORD eventType)
{
if (bMetaProtoEnabled && hContact) {
MCONTACT hMetaContact = (MCONTACT)db_get_dw(hContact, META_PROTO, "Handle", 0);
- if (hMetaContact && isMetaContactsSubContact(hMetaContact, hContact))
+ if (hMetaContact && db_mc_getMeta(hContact) == hMetaContact)
return FALSE;
}