[telepathy-gabble/master] Add constant CapabilitySets for voice-v1 and video-v1

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Sep 8 04:10:01 PDT 2009


The patch was originally by Will Thompson, and only added voice-v1.
---
 src/capabilities.c |   28 ++++++++++++++++++++++++++++
 src/capabilities.h |   29 ++++++++++++++++-------------
 2 files changed, 44 insertions(+), 13 deletions(-)

diff --git a/src/capabilities.c b/src/capabilities.c
index 8c760e0..c08742e 100644
--- a/src/capabilities.c
+++ b/src/capabilities.c
@@ -73,6 +73,34 @@ static const Feature self_advertised_features[] =
   { 0, NULL, 0}
 };
 
+const GabbleCapabilitySet *
+gabble_capabilities_get_bundle_voice_v1 ()
+{
+  static GabbleCapabilitySet *voice_v1_caps = NULL;
+
+  if (voice_v1_caps == NULL)
+    {
+      voice_v1_caps = gabble_capability_set_new ();
+      gabble_capability_set_add (voice_v1_caps, NS_GOOGLE_FEAT_VOICE);
+    }
+
+  return voice_v1_caps;
+}
+
+const GabbleCapabilitySet *
+gabble_capabilities_get_bundle_video_v1 ()
+{
+  static GabbleCapabilitySet *video_v1_caps = NULL;
+
+  if (video_v1_caps == NULL)
+    {
+      video_v1_caps = gabble_capability_set_new ();
+      gabble_capability_set_add (video_v1_caps, NS_GOOGLE_FEAT_VIDEO);
+    }
+
+  return video_v1_caps;
+}
+
 GSList *
 capabilities_get_features (GabblePresenceCapabilities caps,
                            GHashTable *per_channel_manager_caps)
diff --git a/src/capabilities.h b/src/capabilities.h
index a987d11..22fa8eb 100644
--- a/src/capabilities.h
+++ b/src/capabilities.h
@@ -27,18 +27,6 @@
 
 #include "types.h"
 
-/* XEP-0115 version 1.3:
- *
- * "The names of the feature bundles MUST NOT be used for semantic purposes:
- * they are merely opaque identifiers"
- *
- * However, some old Jabber clients (e.g. Gabble 0.2) and various Google
- * clients require the bundle name "voice-v1" and "video-v1". We keep these
- * names for compatibility.
- */
-#define BUNDLE_VOICE_V1         "voice-v1"
-#define BUNDLE_VIDEO_V1         "video-v1"
-
 typedef struct _Feature Feature;
 
 struct _Feature
@@ -46,7 +34,7 @@ struct _Feature
   enum {
     FEATURE_FIXED,
     FEATURE_OPTIONAL,
-    FEATURE_BUNDLE_COMPAT   /* just for voice-v1 */
+    FEATURE_BUNDLE_COMPAT   /* just for voice-v1/video-v1 */
   } feature_type;
   gchar *ns;
   GabblePresenceCapabilities caps;
@@ -77,6 +65,21 @@ gboolean gabble_capability_set_equals (const GabbleCapabilitySet *a,
 void gabble_capability_set_clear (GabbleCapabilitySet *caps);
 void gabble_capability_set_free (GabbleCapabilitySet *caps);
 
+/* XEP-0115 version 1.3:
+ *
+ * "The names of the feature bundles MUST NOT be used for semantic purposes:
+ * they are merely opaque identifiers"
+ *
+ * However, some old Jabber clients (e.g. Gabble 0.2) and various Google
+ * clients require the bundle names "voice-v1" and "video-v1". We keep these
+ * names for compatibility.
+ */
+#define BUNDLE_VOICE_V1         "voice-v1"
+#define BUNDLE_VIDEO_V1         "video-v1"
+
+const GabbleCapabilitySet *gabble_capabilities_get_bundle_voice_v1 (void);
+const GabbleCapabilitySet *gabble_capabilities_get_bundle_video_v1 (void);
+
 /*
  * capabilities_get_features
  *
-- 
1.5.6.5




More information about the telepathy-commits mailing list