[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#687635: unblock: telepathy-gabble/0.16.1-2



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please consider:

    unblock telepathy-gabble/0.16.1-2

telepathy-gabble (0.16.1-2) unstable; urgency=low

  * Add patch from 0.16.2 to fix a potential use-after-free when
    disconnecting with TLS verification channels open
  * Add patches from 0.16.3 to avoid triggering repeated capability discovery
    in iChat (Closes: #687370, LP: #984132)

 -- Simon McVittie <smcv@debian.org>  Fri, 14 Sep 2012 12:39:01 +0100

This contains the functional changes from upstream releases 0.16.2 and
0.16.3, but not the updated regression tests or autoreconf noise.

Full debdiff attached (telepathy-gabble_0.16.1-2.diff), plus broken-out
patches for your convenience.

In future, how would you feel about us using Telepathy upstream
stable-branch releases for this sort of thing, rather than individual patches?
This would generally mean adding unintrusive fixes for 'normal' bugs (like
the first one mentioned in this upload's changelog), some noise from
autoreconf and gtk-doc (which I could pass through filterdiff if you want),
and changes to the regression tests that don't affect the binary packages
(likewise).

(Before you ask, the change in Mission Control 5.12.1 to avoid deprecated
functions was indeed not suitable for a stable branch, and I've reverted it
upstream already. It should have only been in the 5.13 development branch.)

Thanks,
    S
diffstat for telepathy-gabble-0.16.1 telepathy-gabble-0.16.1

 changelog                                                               |    9 
 patches/0001-server-tls-manager-deal-with-modification-of-the-GLi.patch |   39 ++
 patches/0011-Add-Google-camera-v1-as-a-first-class-caps-bundle.patch    |  156 ++++++++++
 patches/0012-Now-that-camera-v1-has-a-caps-URI-don-t-treat-it-as-.patch |   53 +++
 patches/series                                                          |    3 
 5 files changed, 260 insertions(+)

diff -Nru telepathy-gabble-0.16.1/debian/changelog telepathy-gabble-0.16.1/debian/changelog
--- telepathy-gabble-0.16.1/debian/changelog	2012-06-27 12:24:08.000000000 +0100
+++ telepathy-gabble-0.16.1/debian/changelog	2012-09-14 12:39:09.000000000 +0100
@@ -1,3 +1,12 @@
+telepathy-gabble (0.16.1-2) unstable; urgency=low
+
+  * Add patch from 0.16.2 to fix a potential use-after-free when
+    disconnecting with TLS verification channels open
+  * Add patches from 0.16.3 to avoid triggering repeated capability discovery
+    in iChat (Closes: #687370, LP: #984132)
+
+ -- Simon McVittie <smcv@debian.org>  Fri, 14 Sep 2012 12:39:01 +0100
+
 telepathy-gabble (0.16.1-1) unstable; urgency=medium
 
   * Bump priority to medium as this version is fixing connection issues with
diff -Nru telepathy-gabble-0.16.1/debian/patches/0001-server-tls-manager-deal-with-modification-of-the-GLi.patch telepathy-gabble-0.16.1/debian/patches/0001-server-tls-manager-deal-with-modification-of-the-GLi.patch
--- telepathy-gabble-0.16.1/debian/patches/0001-server-tls-manager-deal-with-modification-of-the-GLi.patch	1970-01-01 01:00:00.000000000 +0100
+++ telepathy-gabble-0.16.1/debian/patches/0001-server-tls-manager-deal-with-modification-of-the-GLi.patch	2012-09-14 12:39:09.000000000 +0100
@@ -0,0 +1,39 @@
+From: Jonny Lamb <jonny.lamb@collabora.co.uk>
+Date: Wed, 11 Jul 2012 11:53:03 +0100
+Subject: [PATCH 01/15] server-tls-manager: deal with modification of the
+ GList while iterating it
+
+Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
+Origin: upstream, 0.16.2, commit:f88ae541292e0ff4abd9214bef4c7b99a55dc4e9
+Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53087
+---
+ src/server-tls-manager.c |   13 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/src/server-tls-manager.c b/src/server-tls-manager.c
+index 8dd90fb..c28d2d4 100644
+--- a/src/server-tls-manager.c
++++ b/src/server-tls-manager.c
+@@ -122,8 +122,17 @@ close_all (GabbleServerTLSManager *self)
+   if (self->priv->channel != NULL)
+     tp_base_channel_close (TP_BASE_CHANNEL (self->priv->channel));
+ 
+-  for (l = self->priv->completed_channels; l != NULL; l = l->next)
+-    tp_base_channel_close (l->data);
++  l = self->priv->completed_channels;
++  while (l != NULL)
++    {
++      /* use a temporary variable as the ::closed callback will delete
++       * the link from the list. */
++      GList *next = l->next;
++
++      tp_base_channel_close (l->data);
++
++      l = next;
++    }
+ }
+ 
+ static void
+-- 
+1.7.10.4
+
diff -Nru telepathy-gabble-0.16.1/debian/patches/0011-Add-Google-camera-v1-as-a-first-class-caps-bundle.patch telepathy-gabble-0.16.1/debian/patches/0011-Add-Google-camera-v1-as-a-first-class-caps-bundle.patch
--- telepathy-gabble-0.16.1/debian/patches/0011-Add-Google-camera-v1-as-a-first-class-caps-bundle.patch	1970-01-01 01:00:00.000000000 +0100
+++ telepathy-gabble-0.16.1/debian/patches/0011-Add-Google-camera-v1-as-a-first-class-caps-bundle.patch	2012-09-14 12:39:09.000000000 +0100
@@ -0,0 +1,156 @@
+From: Simon McVittie <simon.mcvittie@collabora.co.uk>
+Date: Fri, 7 Sep 2012 15:18:23 +0100
+Subject: [PATCH 11/15] Add Google camera-v1 as a first-class caps bundle
+
+This is partly a point of principle - given any caps bundle that we have
+ever advertised support for, we should be prepared to define when asked -
+but mainly a workaround for the iChat bug mentioned in commit af55ea3d.
+If we return an error, it will keep disco'ing us repeatedly in a loop.
+
+This leaves us with the problem of finding out what the bundle contains.
+In Google's usage it is only its name that is important (ignoring that
+XEP-0115 explicitly makes bundle names opaque), but replying to disco
+requests for it requires us to be able to turn it into a set of 0 or
+more capability URIs. Because of the Google server bug mentioned in
+commit cd0da0a8, we can't just ask a Google client, because they're
+all on Google servers, so they can't usefully be disco'd.
+
+We assume here that it behaves like the voice-v1 and video-v1 bundles
+in containing exactly one URI, and that that URI corresponds to the
+bundle name in the same way.
+
+Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
+Reviewed-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54634
+Bug-Debian: http://bugs.debian.org/687370
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/telepathy-gabble/+bug/984132
+Origin: upstream, 0.16.3, commit:fbfa8c138da1a4f00c74af4bda98e858a203a58b
+---
+ gabble/capabilities.h |    1 +
+ src/capabilities.c    |   13 +++++++++++++
+ src/connection.c      |    3 +++
+ src/namespaces.h      |    1 +
+ src/presence-cache.c  |    3 +++
+ 5 files changed, 21 insertions(+)
+
+diff --git a/gabble/capabilities.h b/gabble/capabilities.h
+index 81c8c25..dd0a0c9 100644
+--- a/gabble/capabilities.h
++++ b/gabble/capabilities.h
+@@ -65,6 +65,7 @@ const GabbleCapabilitySet *gabble_capabilities_get_olpc_notify (void);
+ const GabbleCapabilitySet *gabble_capabilities_get_bundle_share_v1 (void);
+ const GabbleCapabilitySet *gabble_capabilities_get_bundle_voice_v1 (void);
+ const GabbleCapabilitySet *gabble_capabilities_get_bundle_video_v1 (void);
++const GabbleCapabilitySet *gabble_capabilities_get_bundle_camera_v1 (void);
+ 
+ /* Return the capabilities we always have */
+ const GabbleCapabilitySet *gabble_capabilities_get_fixed_caps (void);
+diff --git a/src/capabilities.c b/src/capabilities.c
+index 14a396a..d2b25f5 100644
+--- a/src/capabilities.c
++++ b/src/capabilities.c
+@@ -77,6 +77,7 @@ static const Feature self_advertised_features[] =
+   { FEATURE_OPTIONAL, NS_GOOGLE_FEAT_SHARE },
+   { FEATURE_OPTIONAL, NS_GOOGLE_FEAT_VOICE },
+   { FEATURE_OPTIONAL, NS_GOOGLE_FEAT_VIDEO },
++  { FEATURE_OPTIONAL, NS_GOOGLE_FEAT_CAMERA },
+   { FEATURE_OPTIONAL, NS_JINGLE_DESCRIPTION_AUDIO },
+   { FEATURE_OPTIONAL, NS_JINGLE_DESCRIPTION_VIDEO },
+   { FEATURE_OPTIONAL, NS_JINGLE_RTP },
+@@ -103,6 +104,7 @@ static GabbleCapabilitySet *legacy_caps = NULL;
+ static GabbleCapabilitySet *share_v1_caps = NULL;
+ static GabbleCapabilitySet *voice_v1_caps = NULL;
+ static GabbleCapabilitySet *video_v1_caps = NULL;
++static GabbleCapabilitySet *camera_v1_caps = NULL;
+ static GabbleCapabilitySet *any_audio_caps = NULL;
+ static GabbleCapabilitySet *any_video_caps = NULL;
+ static GabbleCapabilitySet *any_audio_video_caps = NULL;
+@@ -138,6 +140,12 @@ gabble_capabilities_get_bundle_video_v1 (void)
+ }
+ 
+ const GabbleCapabilitySet *
++gabble_capabilities_get_bundle_camera_v1 (void)
++{
++  return camera_v1_caps;
++}
++
++const GabbleCapabilitySet *
+ gabble_capabilities_get_any_audio (void)
+ {
+   return any_audio_caps;
+@@ -271,6 +279,9 @@ gabble_capabilities_init (gpointer conn)
+       video_v1_caps = gabble_capability_set_new ();
+       gabble_capability_set_add (video_v1_caps, NS_GOOGLE_FEAT_VIDEO);
+ 
++      camera_v1_caps = gabble_capability_set_new ();
++      gabble_capability_set_add (camera_v1_caps, NS_GOOGLE_FEAT_CAMERA);
++
+       any_audio_caps = gabble_capability_set_new ();
+       gabble_capability_set_add (any_audio_caps, NS_JINGLE_RTP_AUDIO);
+       gabble_capability_set_add (any_audio_caps, NS_JINGLE_DESCRIPTION_AUDIO);
+@@ -335,6 +346,7 @@ gabble_capabilities_finalize (gpointer conn)
+       gabble_capability_set_free (share_v1_caps);
+       gabble_capability_set_free (voice_v1_caps);
+       gabble_capability_set_free (video_v1_caps);
++      gabble_capability_set_free (camera_v1_caps);
+       gabble_capability_set_free (any_audio_caps);
+       gabble_capability_set_free (any_video_caps);
+       gabble_capability_set_free (any_audio_video_caps);
+@@ -350,6 +362,7 @@ gabble_capabilities_finalize (gpointer conn)
+       share_v1_caps = NULL;
+       voice_v1_caps = NULL;
+       video_v1_caps = NULL;
++      camera_v1_caps = NULL;
+       any_audio_caps = NULL;
+       any_video_caps = NULL;
+       any_audio_video_caps = NULL;
+diff --git a/src/connection.c b/src/connection.c
+index c1e5946..316af96 100644
+--- a/src/connection.c
++++ b/src/connection.c
+@@ -2707,6 +2707,9 @@ iq_disco_cb (WockyPorter *porter,
+ 
+       if (!tp_strdiff (suffix, BUNDLE_VIDEO_V1))
+         features = gabble_capabilities_get_bundle_video_v1 ();
++
++      if (!tp_strdiff (suffix, BUNDLE_CAMERA_V1))
++        features = gabble_capabilities_get_bundle_camera_v1 ();
+     }
+ 
+   if (data_forms != NULL)
+diff --git a/src/namespaces.h b/src/namespaces.h
+index 4f8415c..13ae5db 100644
+--- a/src/namespaces.h
++++ b/src/namespaces.h
+@@ -35,6 +35,7 @@
+ #define NS_GOOGLE_FEAT_SHARE    "http://google.com/xmpp/protocol/share/v1";
+ #define NS_GOOGLE_FEAT_VOICE    "http://www.google.com/xmpp/protocol/voice/v1";
+ #define NS_GOOGLE_FEAT_VIDEO    "http://www.google.com/xmpp/protocol/video/v1";
++#define NS_GOOGLE_FEAT_CAMERA   "http://www.google.com/xmpp/protocol/camera/v1";
+ #define NS_GOOGLE_JINGLE_INFO   "google:jingleinfo"
+ #define NS_GOOGLE_ROSTER        "google:roster"
+ #define NS_GOOGLE_QUEUE         "google:queue"
+diff --git a/src/presence-cache.c b/src/presence-cache.c
+index 31a3012..72901a0 100644
+--- a/src/presence-cache.c
++++ b/src/presence-cache.c
+@@ -522,6 +522,7 @@ gabble_presence_cache_add_bundles (GabblePresenceCache *cache)
+    */
+   GOOGLE_BUNDLE ("voice-v1", NS_GOOGLE_FEAT_VOICE);
+   GOOGLE_BUNDLE ("video-v1", NS_GOOGLE_FEAT_VIDEO);
++  GOOGLE_BUNDLE ("camera-v1", NS_GOOGLE_FEAT_CAMERA);
+ 
+   /* File transfer support */
+   GOOGLE_BUNDLE ("share-v1", NS_GOOGLE_FEAT_SHARE);
+@@ -550,6 +551,8 @@ gabble_presence_cache_add_bundles (GabblePresenceCache *cache)
+       NS_GABBLE_CAPS "#" BUNDLE_VIDEO_V1, NS_GOOGLE_FEAT_VIDEO);
+   gabble_presence_cache_add_bundle_caps (cache,
+       NS_GABBLE_CAPS "#" BUNDLE_SHARE_V1, NS_GOOGLE_FEAT_SHARE);
++  gabble_presence_cache_add_bundle_caps (cache,
++      NS_GABBLE_CAPS "#" BUNDLE_CAMERA_V1, NS_GOOGLE_FEAT_CAMERA);
+ }
+ 
+ static GObject *
+-- 
+1.7.10.4
+
diff -Nru telepathy-gabble-0.16.1/debian/patches/0012-Now-that-camera-v1-has-a-caps-URI-don-t-treat-it-as-.patch telepathy-gabble-0.16.1/debian/patches/0012-Now-that-camera-v1-has-a-caps-URI-don-t-treat-it-as-.patch
--- telepathy-gabble-0.16.1/debian/patches/0012-Now-that-camera-v1-has-a-caps-URI-don-t-treat-it-as-.patch	1970-01-01 01:00:00.000000000 +0100
+++ telepathy-gabble-0.16.1/debian/patches/0012-Now-that-camera-v1-has-a-caps-URI-don-t-treat-it-as-.patch	2012-09-14 12:39:09.000000000 +0100
@@ -0,0 +1,53 @@
+From: Simon McVittie <simon.mcvittie@collabora.co.uk>
+Date: Fri, 7 Sep 2012 15:19:30 +0100
+Subject: [PATCH 12/15] Now that camera-v1 has a caps URI, don't treat it as
+ part of video-v1
+
+Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54634
+Reviewed-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
+Bug-Debian: http://bugs.debian.org/687370
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/telepathy-gabble/+bug/984132
+Origin: upstream, 0.16.3, commit:da14b4e86d503b30054b10b5e7b00eae7ba1add5
+---
+ src/connection.c    |    5 +++--
+ src/media-factory.c |    5 ++++-
+ 2 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/src/connection.c b/src/connection.c
+index 316af96..5ea0d1a 100644
+--- a/src/connection.c
++++ b/src/connection.c
+@@ -2403,10 +2403,11 @@ gabble_connection_fill_in_caps (GabbleConnection *self,
+   if (voice_v1)
+     g_string_append (ext, " " BUNDLE_VOICE_V1);
+ 
+-  if (video_v1) {
++  if (video_v1)
+     g_string_append (ext, " " BUNDLE_VIDEO_V1);
++
++  if (gabble_presence_has_cap (presence, NS_GOOGLE_FEAT_CAMERA))
+     g_string_append (ext, " " BUNDLE_CAMERA_V1);
+-  }
+ 
+   wocky_node_set_attribute (node, "ext", ext->str);
+   g_string_free (ext, TRUE);
+diff --git a/src/media-factory.c b/src/media-factory.c
+index b52cfc6..493a817 100644
+--- a/src/media-factory.c
++++ b/src/media-factory.c
+@@ -1053,7 +1053,10 @@ gabble_media_factory_add_caps (GabbleCapabilitySet *caps,
+       /* video-v1 implies that we interop with Google Video Chat, i.e. we have
+        * gtalk-p2p and H.264 as well as video */
+       if (gtalk_p2p && h264)
+-        gabble_capability_set_add (caps, NS_GOOGLE_FEAT_VIDEO);
++        {
++          gabble_capability_set_add (caps, NS_GOOGLE_FEAT_VIDEO);
++          gabble_capability_set_add (caps, NS_GOOGLE_FEAT_CAMERA);
++        }
+     }
+ }
+ 
+-- 
+1.7.10.4
+
diff -Nru telepathy-gabble-0.16.1/debian/patches/series telepathy-gabble-0.16.1/debian/patches/series
--- telepathy-gabble-0.16.1/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ telepathy-gabble-0.16.1/debian/patches/series	2012-09-14 12:39:09.000000000 +0100
@@ -0,0 +1,3 @@
+0001-server-tls-manager-deal-with-modification-of-the-GLi.patch
+0011-Add-Google-camera-v1-as-a-first-class-caps-bundle.patch
+0012-Now-that-camera-v1-has-a-caps-URI-don-t-treat-it-as-.patch
From: Jonny Lamb <jonny.lamb@collabora.co.uk>
Date: Wed, 11 Jul 2012 11:53:03 +0100
Subject: [PATCH 01/15] server-tls-manager: deal with modification of the
 GList while iterating it

Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Origin: upstream, 0.16.2, commit:f88ae541292e0ff4abd9214bef4c7b99a55dc4e9
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53087
---
 src/server-tls-manager.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/server-tls-manager.c b/src/server-tls-manager.c
index 8dd90fb..c28d2d4 100644
--- a/src/server-tls-manager.c
+++ b/src/server-tls-manager.c
@@ -122,8 +122,17 @@ close_all (GabbleServerTLSManager *self)
   if (self->priv->channel != NULL)
     tp_base_channel_close (TP_BASE_CHANNEL (self->priv->channel));
 
-  for (l = self->priv->completed_channels; l != NULL; l = l->next)
-    tp_base_channel_close (l->data);
+  l = self->priv->completed_channels;
+  while (l != NULL)
+    {
+      /* use a temporary variable as the ::closed callback will delete
+       * the link from the list. */
+      GList *next = l->next;
+
+      tp_base_channel_close (l->data);
+
+      l = next;
+    }
 }
 
 static void
-- 
1.7.10.4

From: Simon McVittie <simon.mcvittie@collabora.co.uk>
Date: Fri, 7 Sep 2012 15:18:23 +0100
Subject: [PATCH 11/15] Add Google camera-v1 as a first-class caps bundle

This is partly a point of principle - given any caps bundle that we have
ever advertised support for, we should be prepared to define when asked -
but mainly a workaround for the iChat bug mentioned in commit af55ea3d.
If we return an error, it will keep disco'ing us repeatedly in a loop.

This leaves us with the problem of finding out what the bundle contains.
In Google's usage it is only its name that is important (ignoring that
XEP-0115 explicitly makes bundle names opaque), but replying to disco
requests for it requires us to be able to turn it into a set of 0 or
more capability URIs. Because of the Google server bug mentioned in
commit cd0da0a8, we can't just ask a Google client, because they're
all on Google servers, so they can't usefully be disco'd.

We assume here that it behaves like the voice-v1 and video-v1 bundles
in containing exactly one URI, and that that URI corresponds to the
bundle name in the same way.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54634
Bug-Debian: http://bugs.debian.org/687370
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/telepathy-gabble/+bug/984132
Origin: upstream, 0.16.3, commit:fbfa8c138da1a4f00c74af4bda98e858a203a58b
---
 gabble/capabilities.h |    1 +
 src/capabilities.c    |   13 +++++++++++++
 src/connection.c      |    3 +++
 src/namespaces.h      |    1 +
 src/presence-cache.c  |    3 +++
 5 files changed, 21 insertions(+)

diff --git a/gabble/capabilities.h b/gabble/capabilities.h
index 81c8c25..dd0a0c9 100644
--- a/gabble/capabilities.h
+++ b/gabble/capabilities.h
@@ -65,6 +65,7 @@ const GabbleCapabilitySet *gabble_capabilities_get_olpc_notify (void);
 const GabbleCapabilitySet *gabble_capabilities_get_bundle_share_v1 (void);
 const GabbleCapabilitySet *gabble_capabilities_get_bundle_voice_v1 (void);
 const GabbleCapabilitySet *gabble_capabilities_get_bundle_video_v1 (void);
+const GabbleCapabilitySet *gabble_capabilities_get_bundle_camera_v1 (void);
 
 /* Return the capabilities we always have */
 const GabbleCapabilitySet *gabble_capabilities_get_fixed_caps (void);
diff --git a/src/capabilities.c b/src/capabilities.c
index 14a396a..d2b25f5 100644
--- a/src/capabilities.c
+++ b/src/capabilities.c
@@ -77,6 +77,7 @@ static const Feature self_advertised_features[] =
   { FEATURE_OPTIONAL, NS_GOOGLE_FEAT_SHARE },
   { FEATURE_OPTIONAL, NS_GOOGLE_FEAT_VOICE },
   { FEATURE_OPTIONAL, NS_GOOGLE_FEAT_VIDEO },
+  { FEATURE_OPTIONAL, NS_GOOGLE_FEAT_CAMERA },
   { FEATURE_OPTIONAL, NS_JINGLE_DESCRIPTION_AUDIO },
   { FEATURE_OPTIONAL, NS_JINGLE_DESCRIPTION_VIDEO },
   { FEATURE_OPTIONAL, NS_JINGLE_RTP },
@@ -103,6 +104,7 @@ static GabbleCapabilitySet *legacy_caps = NULL;
 static GabbleCapabilitySet *share_v1_caps = NULL;
 static GabbleCapabilitySet *voice_v1_caps = NULL;
 static GabbleCapabilitySet *video_v1_caps = NULL;
+static GabbleCapabilitySet *camera_v1_caps = NULL;
 static GabbleCapabilitySet *any_audio_caps = NULL;
 static GabbleCapabilitySet *any_video_caps = NULL;
 static GabbleCapabilitySet *any_audio_video_caps = NULL;
@@ -138,6 +140,12 @@ gabble_capabilities_get_bundle_video_v1 (void)
 }
 
 const GabbleCapabilitySet *
+gabble_capabilities_get_bundle_camera_v1 (void)
+{
+  return camera_v1_caps;
+}
+
+const GabbleCapabilitySet *
 gabble_capabilities_get_any_audio (void)
 {
   return any_audio_caps;
@@ -271,6 +279,9 @@ gabble_capabilities_init (gpointer conn)
       video_v1_caps = gabble_capability_set_new ();
       gabble_capability_set_add (video_v1_caps, NS_GOOGLE_FEAT_VIDEO);
 
+      camera_v1_caps = gabble_capability_set_new ();
+      gabble_capability_set_add (camera_v1_caps, NS_GOOGLE_FEAT_CAMERA);
+
       any_audio_caps = gabble_capability_set_new ();
       gabble_capability_set_add (any_audio_caps, NS_JINGLE_RTP_AUDIO);
       gabble_capability_set_add (any_audio_caps, NS_JINGLE_DESCRIPTION_AUDIO);
@@ -335,6 +346,7 @@ gabble_capabilities_finalize (gpointer conn)
       gabble_capability_set_free (share_v1_caps);
       gabble_capability_set_free (voice_v1_caps);
       gabble_capability_set_free (video_v1_caps);
+      gabble_capability_set_free (camera_v1_caps);
       gabble_capability_set_free (any_audio_caps);
       gabble_capability_set_free (any_video_caps);
       gabble_capability_set_free (any_audio_video_caps);
@@ -350,6 +362,7 @@ gabble_capabilities_finalize (gpointer conn)
       share_v1_caps = NULL;
       voice_v1_caps = NULL;
       video_v1_caps = NULL;
+      camera_v1_caps = NULL;
       any_audio_caps = NULL;
       any_video_caps = NULL;
       any_audio_video_caps = NULL;
diff --git a/src/connection.c b/src/connection.c
index c1e5946..316af96 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -2707,6 +2707,9 @@ iq_disco_cb (WockyPorter *porter,
 
       if (!tp_strdiff (suffix, BUNDLE_VIDEO_V1))
         features = gabble_capabilities_get_bundle_video_v1 ();
+
+      if (!tp_strdiff (suffix, BUNDLE_CAMERA_V1))
+        features = gabble_capabilities_get_bundle_camera_v1 ();
     }
 
   if (data_forms != NULL)
diff --git a/src/namespaces.h b/src/namespaces.h
index 4f8415c..13ae5db 100644
--- a/src/namespaces.h
+++ b/src/namespaces.h
@@ -35,6 +35,7 @@
 #define NS_GOOGLE_FEAT_SHARE    "http://google.com/xmpp/protocol/share/v1";
 #define NS_GOOGLE_FEAT_VOICE    "http://www.google.com/xmpp/protocol/voice/v1";
 #define NS_GOOGLE_FEAT_VIDEO    "http://www.google.com/xmpp/protocol/video/v1";
+#define NS_GOOGLE_FEAT_CAMERA   "http://www.google.com/xmpp/protocol/camera/v1";
 #define NS_GOOGLE_JINGLE_INFO   "google:jingleinfo"
 #define NS_GOOGLE_ROSTER        "google:roster"
 #define NS_GOOGLE_QUEUE         "google:queue"
diff --git a/src/presence-cache.c b/src/presence-cache.c
index 31a3012..72901a0 100644
--- a/src/presence-cache.c
+++ b/src/presence-cache.c
@@ -522,6 +522,7 @@ gabble_presence_cache_add_bundles (GabblePresenceCache *cache)
    */
   GOOGLE_BUNDLE ("voice-v1", NS_GOOGLE_FEAT_VOICE);
   GOOGLE_BUNDLE ("video-v1", NS_GOOGLE_FEAT_VIDEO);
+  GOOGLE_BUNDLE ("camera-v1", NS_GOOGLE_FEAT_CAMERA);
 
   /* File transfer support */
   GOOGLE_BUNDLE ("share-v1", NS_GOOGLE_FEAT_SHARE);
@@ -550,6 +551,8 @@ gabble_presence_cache_add_bundles (GabblePresenceCache *cache)
       NS_GABBLE_CAPS "#" BUNDLE_VIDEO_V1, NS_GOOGLE_FEAT_VIDEO);
   gabble_presence_cache_add_bundle_caps (cache,
       NS_GABBLE_CAPS "#" BUNDLE_SHARE_V1, NS_GOOGLE_FEAT_SHARE);
+  gabble_presence_cache_add_bundle_caps (cache,
+      NS_GABBLE_CAPS "#" BUNDLE_CAMERA_V1, NS_GOOGLE_FEAT_CAMERA);
 }
 
 static GObject *
-- 
1.7.10.4

From: Simon McVittie <simon.mcvittie@collabora.co.uk>
Date: Fri, 7 Sep 2012 15:19:30 +0100
Subject: [PATCH 12/15] Now that camera-v1 has a caps URI, don't treat it as
 part of video-v1

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54634
Reviewed-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug-Debian: http://bugs.debian.org/687370
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/telepathy-gabble/+bug/984132
Origin: upstream, 0.16.3, commit:da14b4e86d503b30054b10b5e7b00eae7ba1add5
---
 src/connection.c    |    5 +++--
 src/media-factory.c |    5 ++++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/connection.c b/src/connection.c
index 316af96..5ea0d1a 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -2403,10 +2403,11 @@ gabble_connection_fill_in_caps (GabbleConnection *self,
   if (voice_v1)
     g_string_append (ext, " " BUNDLE_VOICE_V1);
 
-  if (video_v1) {
+  if (video_v1)
     g_string_append (ext, " " BUNDLE_VIDEO_V1);
+
+  if (gabble_presence_has_cap (presence, NS_GOOGLE_FEAT_CAMERA))
     g_string_append (ext, " " BUNDLE_CAMERA_V1);
-  }
 
   wocky_node_set_attribute (node, "ext", ext->str);
   g_string_free (ext, TRUE);
diff --git a/src/media-factory.c b/src/media-factory.c
index b52cfc6..493a817 100644
--- a/src/media-factory.c
+++ b/src/media-factory.c
@@ -1053,7 +1053,10 @@ gabble_media_factory_add_caps (GabbleCapabilitySet *caps,
       /* video-v1 implies that we interop with Google Video Chat, i.e. we have
        * gtalk-p2p and H.264 as well as video */
       if (gtalk_p2p && h264)
-        gabble_capability_set_add (caps, NS_GOOGLE_FEAT_VIDEO);
+        {
+          gabble_capability_set_add (caps, NS_GOOGLE_FEAT_VIDEO);
+          gabble_capability_set_add (caps, NS_GOOGLE_FEAT_CAMERA);
+        }
     }
 }
 
-- 
1.7.10.4


Reply to: