summaryrefslogtreecommitdiff
path: root/metacontacts.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2010-09-24 11:48:03 +0300
committerGluzskiy Alexandr <sss123next@list.ru>2010-09-24 11:48:03 +0300
commit6d88cf817136473cfb98332cb4616e3563e33971 (patch)
treecd1f732b3cb10cc91e52e3411a3595d2a80a4279 /metacontacts.cpp
parenta2d855c24796591e73ce8f2160746716aec6516e (diff)
replacer
Diffstat (limited to 'metacontacts.cpp')
-rw-r--r--metacontacts.cpp71
1 files changed, 71 insertions, 0 deletions
diff --git a/metacontacts.cpp b/metacontacts.cpp
new file mode 100644
index 0000000..6c49411
--- /dev/null
+++ b/metacontacts.cpp
@@ -0,0 +1,71 @@
+// Copyright © 2010 SecureIM developers (baloo and others), sss
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+#include "commonheaders.h"
+
+extern bool bMetaContacts;
+
+BOOL isProtoMetaContacts(HANDLE hContact)
+{
+ if(bMetaContacts) {
+ LPSTR proto = (LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ if( proto && strcmp(proto,"MetaContacts")==0 ) {
+ return true;
+ }
+ }
+ return false;
+}
+
+
+BOOL metaIsDefaultSubContact(HANDLE hContact)
+{
+
+ if(bMetaContacts)
+ return (HANDLE)CallService(MS_MC_GETDEFAULTCONTACT,(WPARAM)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0),0)==hContact;
+ return false;
+}
+
+
+HANDLE metaGetContact(HANDLE hContact)
+{
+ if(bMetaContacts)
+ return (HANDLE)CallService(MS_MC_GETMETACONTACT,(WPARAM)hContact,0);
+ return 0;
+}
+
+
+HANDLE metaGetMostOnline(HANDLE hContact)
+{
+
+ if(bMetaContacts)
+ return (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(WPARAM)hContact,0);
+ return 0;
+}
+
+DWORD metaGetContactsNum(HANDLE hContact)
+{
+ if(bMetaContacts)
+ return CallService(MS_MC_GETNUMCONTACTS, (WPARAM)hContact, 0);
+ return 0;
+}
+HANDLE metaGetSubcontact(HANDLE hContact, int num)
+{
+ if(bMetaContacts)
+ return (HANDLE)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, (LPARAM)num);
+ return 0;
+}
+
+