[telepathy-gabble/master] _gabble_media_channel_typeflags_to_caps: don't reassert caps that we always have anyway

Simon McVittie simon.mcvittie at collabora.co.uk
Mon Aug 24 06:02:36 PDT 2009


If we do, then removing StreamedMedia capabilities will make us remove
these caps from our presence, which is presumably not intentional.

Also amend the caps tests to catch up with this change by expecting all Jingle
dialects, and the raw UDP transport, to be advertised regardless of caps.
---
 src/media-channel.c          |    7 -------
 tests/twisted/caps_helper.py |   11 +++++------
 2 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/src/media-channel.c b/src/media-channel.c
index aed67d4..6a87e98 100644
--- a/src/media-channel.c
+++ b/src/media-channel.c
@@ -2493,10 +2493,6 @@ stream_direction_changed_cb (GabbleMediaStream *stream,
 #define GTALK_VIDEO_CAPS \
    ( PRESENCE_CAP_GOOGLE_VIDEO )
 
-#define JINGLE_CAPS \
-  ( PRESENCE_CAP_JINGLE015 | PRESENCE_CAP_JINGLE032 \
-  | PRESENCE_CAP_JINGLE_TRANSPORT_RAWUDP )
-
 #define JINGLE_AUDIO_CAPS \
   ( PRESENCE_CAP_JINGLE_RTP | PRESENCE_CAP_JINGLE_RTP_AUDIO \
   | PRESENCE_CAP_JINGLE_DESCRIPTION_AUDIO )
@@ -2515,9 +2511,6 @@ _gabble_media_channel_typeflags_to_caps (TpChannelMediaCapabilities flags)
     flags & TP_CHANNEL_MEDIA_CAPABILITY_AUDIO ? "audio" : "no audio",
     flags & TP_CHANNEL_MEDIA_CAPABILITY_VIDEO ? "video" : "no video");
 
-  /* We speak Jingle (old and new), and can always do raw UDP */
-  caps |= JINGLE_CAPS;
-
   if (flags & TP_CHANNEL_MEDIA_CAPABILITY_NAT_TRAVERSAL_ICE_UDP)
     caps |= PRESENCE_CAP_JINGLE_TRANSPORT_ICEUDP;
 
diff --git a/tests/twisted/caps_helper.py b/tests/twisted/caps_helper.py
index 1a2c83b..5778909 100644
--- a/tests/twisted/caps_helper.py
+++ b/tests/twisted/caps_helper.py
@@ -14,7 +14,10 @@ import constants as cs
 
 # The caps we always have, regardless of any clients' caps
 FIXED_CAPS = [
+    ns.JINGLE,
+    ns.JINGLE_015,
     ns.GOOGLE_FEAT_SESSION,
+    ns.JINGLE_TRANSPORT_RAWUDP,
     ns.NICK,
     ns.NICK + '+notify',
     ns.CHAT_STATES,
@@ -24,14 +27,10 @@ FIXED_CAPS = [
     ]
 
 JINGLE_CAPS = [
-    # Jingle dialects
-    ns.JINGLE,
-    ns.JINGLE_015,
-    # Jingle transports
+    # Additional Jingle transports
     ns.JINGLE_TRANSPORT_ICEUDP,
-    ns.JINGLE_TRANSPORT_RAWUDP,
     ns.GOOGLE_P2P,
-    # Jingle streams
+    # Jingle content types
     ns.GOOGLE_FEAT_VOICE,
     ns.GOOGLE_FEAT_VIDEO,
     ns.JINGLE_015_AUDIO,
-- 
1.5.6.5




More information about the telepathy-commits mailing list