From 33ed395de0eb385315d949c77b4e1289a6684112 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 31 Mar 2013 19:09:56 +0000 Subject: code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@4267 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SecureIM/src/crypt_metacontacts.cpp | 70 +++++++++++++---------------- 1 file changed, 30 insertions(+), 40 deletions(-) (limited to 'plugins/SecureIM/src/crypt_metacontacts.cpp') diff --git a/plugins/SecureIM/src/crypt_metacontacts.cpp b/plugins/SecureIM/src/crypt_metacontacts.cpp index d78f4adc49..87e948716a 100644 --- a/plugins/SecureIM/src/crypt_metacontacts.cpp +++ b/plugins/SecureIM/src/crypt_metacontacts.cpp @@ -1,58 +1,48 @@ #include "commonheaders.h" - -BOOL isProtoMetaContacts(HANDLE hContact) { - if (bMetaContacts) { - LPSTR proto = GetContactProto(hContact); - if ( proto && strcmp(proto,"MetaContacts")==0 ) { - return true; - } - } -// for(int j=0;jinspecting) -// return strstr(clist[j].proto->name,"MetaContacts")!=NULL; - return false; +BOOL isProtoMetaContacts(HANDLE hContact) +{ + if (bMetaContacts) { + LPSTR proto = GetContactProto(hContact); + if ( proto && !strcmp(proto,"MetaContacts")) + return true; + } + return false; } +BOOL isDefaultSubContact(HANDLE hContact) +{ + if (bMetaContacts) + return (HANDLE)CallService(MS_MC_GETDEFAULTCONTACT,(WPARAM)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0),0) == hContact; -BOOL isDefaultSubContact(HANDLE hContact) { - - if (bMetaContacts) { - return (HANDLE)CallService(MS_MC_GETDEFAULTCONTACT,(WPARAM)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0),0)==hContact; - } - return false; + return false; } +HANDLE getMetaContact(HANDLE hContact) +{ + if (bMetaContacts) + return (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0); -HANDLE getMetaContact(HANDLE hContact) { - - if (bMetaContacts) { - return (HANDLE)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0); - } - return 0; + return 0; } +HANDLE getMostOnline(HANDLE hContact) +{ + if (bMetaContacts) + return (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0); -HANDLE getMostOnline(HANDLE hContact) { - - if (bMetaContacts) { - return (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(WPARAM)hContact,0); - } - return 0; + return 0; } - // remove all secureim connections on subcontacts -void DeinitMetaContact(HANDLE hContact) { - +void DeinitMetaContact(HANDLE hContact) +{ HANDLE hMetaContact = isProtoMetaContacts(hContact) ? hContact : getMetaContact(hContact); - - if ( hMetaContact ) { - for(int i=0;i