summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlli Salli <olli.salli@collabora.co.uk>2012-03-16 17:08:49 (GMT)
committerOlli Salli <olli.salli@collabora.co.uk>2012-03-16 17:08:49 (GMT)
commit8c31eb275050fd62e2c486211c4cb34b10cd8fe4 (patch)
tree6899db55c59c520593732833dd11e54bd5303aaa
parenta8011aa7e549cfde28adad41d1a1c6f39fafba69 (diff)
downloadwocky-8c31eb275050fd62e2c486211c4cb34b10cd8fe4.tar.gz
wocky-8c31eb275050fd62e2c486211c4cb34b10cd8fe4.tar.xz
Add has_feature to the WockyXep0115Capabilities interface
-rw-r--r--wocky/wocky-xep-0115-capabilities.c17
-rw-r--r--wocky/wocky-xep-0115-capabilities.h13
2 files changed, 27 insertions, 3 deletions
diff --git a/wocky/wocky-xep-0115-capabilities.c b/wocky/wocky-xep-0115-capabilities.c
index e9c67d4..8a0438e 100644
--- a/wocky/wocky-xep-0115-capabilities.c
+++ b/wocky/wocky-xep-0115-capabilities.c
@@ -2,7 +2,7 @@
* wocky-xep-0115-capabilities.c - interface for holding capabilities
* of contacts
*
- * Copyright (C) 2011 Collabora Ltd.
+ * Copyright (C) 2011-2012 Collabora Ltd.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -58,3 +58,18 @@ wocky_xep_0115_capabilities_get_data_forms (
return NULL;
}
+
+gboolean
+wocky_xep_0115_capabilities_has_feature (
+ WockyXep0115Capabilities *contact,
+ const gchar *feature)
+{
+ WockyXep0115CapabilitiesInterface *iface =
+ WOCKY_XEP_0115_CAPABILITIES_GET_INTERFACE (contact);
+ WockyXep0115CapabilitiesHasFeatureFunc method = iface->has_feature;
+
+ if (method != NULL)
+ return method (contact, feature);
+
+ return FALSE;
+}
diff --git a/wocky/wocky-xep-0115-capabilities.h b/wocky/wocky-xep-0115-capabilities.h
index 5d65ce3..4506ff4 100644
--- a/wocky/wocky-xep-0115-capabilities.h
+++ b/wocky/wocky-xep-0115-capabilities.h
@@ -2,7 +2,7 @@
* wocky-xep-0115-capabilities.h - interface for holding capabilities
* of contacts
*
- * Copyright (C) 2011 Collabora Ltd.
+ * Copyright (C) 2011-2012 Collabora Ltd.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -52,14 +52,23 @@ typedef struct _WockyXep0115CapabilitiesInterface WockyXep0115CapabilitiesInterf
typedef const GPtrArray * (*WockyXep0115CapabilitiesGetDataFormsFunc) (
WockyXep0115Capabilities *contact);
+typedef gboolean (*WockyXep0115CapabilitiesHasFeatureFunc) (
+ WockyXep0115Capabilities *contact,
+ const gchar *feature);
+
const GPtrArray * wocky_xep_0115_capabilities_get_data_forms (
WockyXep0115Capabilities *contact);
+gboolean wocky_xep_0115_capabilities_has_feature (
+ WockyXep0115Capabilities *contact,
+ const gchar *feature);
+
struct _WockyXep0115CapabilitiesInterface {
GTypeInterface parent;
- /* TODO: features and identites! */
+ /* TODO: capability enumeration and identities! */
WockyXep0115CapabilitiesGetDataFormsFunc get_data_forms;
+ WockyXep0115CapabilitiesHasFeatureFunc has_feature;
};
GType wocky_xep_0115_capabilities_get_type (void);