From 5b66750e1759aef824fab28d8e36f349bc060f20 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sat, 9 Oct 2010 06:06:01 +0300 Subject: metacontacts .... --- metacontacts.cpp | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'metacontacts.cpp') diff --git a/metacontacts.cpp b/metacontacts.cpp index 6c49411..b0eb8bf 100644 --- a/metacontacts.cpp +++ b/metacontacts.cpp @@ -18,7 +18,7 @@ extern bool bMetaContacts; -BOOL isProtoMetaContacts(HANDLE hContact) +bool metaIsProtoMetaContacts(HANDLE hContact) { if(bMetaContacts) { LPSTR proto = (LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); @@ -30,7 +30,7 @@ BOOL isProtoMetaContacts(HANDLE hContact) } -BOOL metaIsDefaultSubContact(HANDLE hContact) +bool metaIsDefaultSubContact(HANDLE hContact) { if(bMetaContacts) @@ -45,6 +45,12 @@ HANDLE metaGetContact(HANDLE hContact) return (HANDLE)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0); return 0; } +bool metaIsSubcontact(HANDLE hContact) +{ + if(bMetaContacts) + return (HANDLE)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0); + return false; +} HANDLE metaGetMostOnline(HANDLE hContact) @@ -54,6 +60,29 @@ HANDLE metaGetMostOnline(HANDLE hContact) return (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(WPARAM)hContact,0); return 0; } +HANDLE metaGetDefault(HANDLE hContact) +{ + + if(bMetaContacts) + return (HANDLE)CallService(MS_MC_GETDEFAULTCONTACT,(WPARAM)hContact,0); + return 0; +} + +HANDLE metaGetCurrent(HANDLE hContact) +{ + bool IsOnline(HANDLE hContact); + if(bMetaContacts) + { + if(!metaIsProtoMetaContacts(hContact)) + return hContact; + HANDLE hcnt = metaGetDefault(hContact); + if(!IsOnline(hcnt)) + hcnt = metaGetMostOnline(hContact); + return hcnt; + } + return hContact; +} + DWORD metaGetContactsNum(HANDLE hContact) { -- cgit v1.2.3