[telepathy-gabble/telepathy-gabble-0.8] connection_iq_disco_cb: simplify handling of voice-v1 disco, and add video-v1

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Sep 8 08:30:26 PDT 2009


We support two bundles for interop with obsolete clients, each with one
feature. As such, there seems little point in populating disco replies in
a data-driven way: instead, we can just special-case the two bundles.
---
 src/connection.c |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/connection.c b/src/connection.c
index 7eaaf54..fda8b60 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -1718,19 +1718,12 @@ connection_iq_disco_cb (LmMessageHandler *handler,
 
   caps_hash = caps_hash_compute_from_self_presence (self);
 
-  if (NULL == node ||
-      !tp_strdiff (suffix, BUNDLE_VOICE_V1) ||
-      !tp_strdiff (suffix, caps_hash))
+  if (node == NULL || !tp_strdiff (suffix, caps_hash))
     {
       for (i = features; NULL != i; i = i->next)
         {
           const Feature *feature = (const Feature *) i->data;
 
-          /* When BUNDLE_VOICE_V1 is requested, only send the bundle */
-          if (!tp_strdiff (suffix, BUNDLE_VOICE_V1) &&
-              feature->feature_type != FEATURE_BUNDLE_COMPAT)
-            continue;
-
           add_feature_node (result_query, feature->ns);
         }
 
@@ -1738,6 +1731,18 @@ connection_iq_disco_cb (LmMessageHandler *handler,
       _gabble_connection_send_or_complain (self, result,
           "sending disco response failed");
     }
+  else if (!tp_strdiff (suffix, BUNDLE_VOICE_V1))
+    {
+      add_feature_node (result_query, NS_GOOGLE_FEAT_VOICE);
+      _gabble_connection_send_or_complain (self, result,
+          "sending disco response failed");
+    }
+  else if (!tp_strdiff (suffix, BUNDLE_VIDEO_V1))
+    {
+      add_feature_node (result_query, NS_GOOGLE_FEAT_VIDEO);
+      _gabble_connection_send_or_complain (self, result,
+          "sending disco response failed");
+    }
   else
     {
       /* Return <item-not-found>. It is possible that the remote contact
-- 
1.5.6.5




More information about the telepathy-commits mailing list