summaryrefslogtreecommitdiff
path: root/SecureIM/crypt_metacontacts.cpp
diff options
context:
space:
mode:
authormataes2007 <mataes2007@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb>2011-11-26 15:41:10 +0000
committermataes2007 <mataes2007@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb>2011-11-26 15:41:10 +0000
commitf04d64869f3b1de54fb343f28f955584780001b8 (patch)
tree5453dc10de3d980de79ffe019fa0b5fcb692a27d /SecureIM/crypt_metacontacts.cpp
parent7aff1e4cb053394db57c2814d5fe1e6493e0cc75 (diff)
Project folders rename part 3
git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@215 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb
Diffstat (limited to 'SecureIM/crypt_metacontacts.cpp')
-rw-r--r--SecureIM/crypt_metacontacts.cpp60
1 files changed, 60 insertions, 0 deletions
diff --git a/SecureIM/crypt_metacontacts.cpp b/SecureIM/crypt_metacontacts.cpp
new file mode 100644
index 0000000..5a24c6c
--- /dev/null
+++ b/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;j<clist_cnt;j++)
+// if(clist[j].hContact==hContact && clist[j].proto->inspecting)
+// 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<CallService(MS_MC_GETNUMCONTACTS,(WPARAM)hMetaContact,0);i++) {
+ HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETSUBCONTACT,(WPARAM)hMetaContact,(LPARAM)i);
+ if( hSubContact && isContactSecured(hSubContact)&SECURED ) {
+ CallContactService(hSubContact,PSS_MESSAGE,(WPARAM)PREF_METANODB,(LPARAM)SIG_DEIN);
+ }
+ }
+ }
+}
+
+// EOF