From 48540940b6c28bb4378abfeb500ec45a625b37b6 Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Tue, 15 May 2012 10:38:20 +0000 Subject: initial commit git-svn-id: http://svn.miranda-ng.org/main/trunk@2 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SecureIM/crypt_metacontacts.cpp | 60 +++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 plugins/SecureIM/crypt_metacontacts.cpp (limited to 'plugins/SecureIM/crypt_metacontacts.cpp') diff --git a/plugins/SecureIM/crypt_metacontacts.cpp b/plugins/SecureIM/crypt_metacontacts.cpp new file mode 100644 index 0000000000..5a24c6c9cb --- /dev/null +++ b/plugins/SecureIM/crypt_metacontacts.cpp @@ -0,0 +1,60 @@ +#include "commonheaders.h" + + +BOOL isProtoMetaContacts(HANDLE hContact) { + if(bMetaContacts) { + LPSTR proto = (LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); + if( proto && strcmp(proto,"MetaContacts")==0 ) { + return true; + } + } +// for(int j=0;jinspecting) +// return strstr(clist[j].proto->name,"MetaContacts")!=NULL; + return false; +} + + +BOOL isDefaultSubContact(HANDLE hContact) { + + if(bMetaContacts) { + return (HANDLE)CallService(MS_MC_GETDEFAULTCONTACT,(WPARAM)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0),0)==hContact; + } + return false; +} + + +HANDLE getMetaContact(HANDLE hContact) { + + if(bMetaContacts) { + return (HANDLE)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0); + } + return 0; +} + + +HANDLE getMostOnline(HANDLE hContact) { + + if(bMetaContacts) { + return (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(WPARAM)hContact,0); + } + return 0; +} + + +// remove all secureim connections on subcontacts +void DeinitMetaContact(HANDLE hContact) { + + HANDLE hMetaContact = isProtoMetaContacts(hContact) ? hContact : getMetaContact(hContact); + + if( hMetaContact ) { + for(int i=0;i