From a9580df150d799246eaecbf3c1fb5cecf9f8ab49 Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Mon, 23 Jul 2012 13:49:28 +0000 Subject: SecureIM, SeenPlugin, SendSS, Sessions: changed folder structure git-svn-id: http://svn.miranda-ng.org/main/trunk@1122 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SecureIM/src/crypt_metacontacts.cpp | 60 +++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 plugins/SecureIM/src/crypt_metacontacts.cpp (limited to 'plugins/SecureIM/src/crypt_metacontacts.cpp') diff --git a/plugins/SecureIM/src/crypt_metacontacts.cpp b/plugins/SecureIM/src/crypt_metacontacts.cpp new file mode 100644 index 0000000000..f36c7e4dd3 --- /dev/null +++ b/plugins/SecureIM/src/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