From 56da56c83e2122a5a92b6939f84bf4d351cc16af Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 11 Sep 2013 17:10:51 +0100 Subject: [PATCH 5/5] Remove support for ye olde Capabilities --- src/Makefile.am | 2 - src/connection.c | 378 +--------------------------- src/legacy-caps.c | 40 --- src/legacy-caps.h | 42 ---- tests/twisted/Makefile.am | 1 - tests/twisted/caps/advertise-legacy.py | 110 -------- tests/twisted/caps/caps-cache.py | 9 +- tests/twisted/caps/caps-persistent-cache.py | 4 - tests/twisted/caps/from-bare-jid.py | 22 +- tests/twisted/caps/hashed-caps.py | 65 ++--- tests/twisted/caps/jingle-caps.py | 13 +- tests/twisted/caps/offline.py | 8 - tests/twisted/caps/receive-jingle.py | 64 +---- tests/twisted/caps_helper.py | 3 - 14 files changed, 39 insertions(+), 722 deletions(-) delete mode 100644 src/legacy-caps.c delete mode 100644 src/legacy-caps.h delete mode 100644 tests/twisted/caps/advertise-legacy.py diff --git a/src/Makefile.am b/src/Makefile.am index 22a0278..bc2ccef 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -73,8 +73,6 @@ libgabble_convenience_la_SOURCES = \ im-channel.c \ im-factory.h \ im-factory.c \ - legacy-caps.h \ - legacy-caps.c \ message-util.h \ message-util.c \ muc-channel.h \ diff --git a/src/connection.c b/src/connection.c index 5556b1e..7d32eeb 100644 --- a/src/connection.c +++ b/src/connection.c @@ -57,7 +57,6 @@ #include "debug.h" #include "disco.h" #include "im-factory.h" -#include "legacy-caps.h" #include "muc-factory.h" #include "namespaces.h" #include "presence-cache.h" @@ -84,10 +83,7 @@ static guint disco_reply_timeout = 5; #define DISCONNECT_TIMEOUT 5 -static void capabilities_service_iface_init (gpointer, gpointer); static void gabble_conn_contact_caps_iface_init (gpointer, gpointer); -static void conn_capabilities_fill_contact_attributes (GObject *obj, - const GArray *contacts, GHashTable *attributes_hash); static void conn_contact_capabilities_fill_contact_attributes (GObject *obj, const GArray *contacts, GHashTable *attributes_hash); static void gabble_plugin_connection_iface_init ( @@ -107,8 +103,6 @@ G_DEFINE_TYPE_WITH_CODE(GabbleConnection, conn_avatars_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_INFO, conn_contact_info_iface_init); - G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CAPABILITIES, - capabilities_service_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACTS, @@ -251,11 +245,8 @@ struct _GabbleConnectionPrivate /* subscriptions on behalf of the Connection, like PEP "+notify" * namespaces (this one is add-only) */ GabbleCapabilitySet *notify_caps; - /* caps provided by Capabilities.AdvertiseCapabilities (tp-spec 0.16) */ - GabbleCapabilitySet *legacy_caps; /* additional caps that we advertise until the first call to - * AdvertiseCapabilities or UpdateCapabilities, for vague historical - * reasons */ + * UpdateCapabilities, for vague historical reasons */ GabbleCapabilitySet *bonus_caps; /* sidecar caps set by gabble_connection_update_sidecar_capabilities */ GabbleCapabilitySet *sidecar_caps; @@ -457,10 +448,6 @@ gabble_connection_constructor (GType type, conn_addressing_init (self); tp_contacts_mixin_add_contact_attributes_iface (G_OBJECT (self), - TP_IFACE_CONNECTION_INTERFACE_CAPABILITIES, - conn_capabilities_fill_contact_attributes); - - tp_contacts_mixin_add_contact_attributes_iface (G_OBJECT (self), TP_IFACE_CONNECTION_INTERFACE_CONTACT_CAPABILITIES, conn_contact_capabilities_fill_contact_attributes); @@ -480,7 +467,6 @@ gabble_connection_constructor (GType type, priv->all_caps = gabble_capability_set_new (); priv->notify_caps = gabble_capability_set_new (); - priv->legacy_caps = gabble_capability_set_new (); priv->sidecar_caps = gabble_capability_set_new (); priv->client_caps = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) gabble_capability_set_free); @@ -489,7 +475,7 @@ gabble_connection_constructor (GType type, g_free, (GDestroyNotify) g_ptr_array_unref); /* Historically, the optional Jingle transports were in our initial - * presence, but could be removed by AdvertiseCapabilities(). Emulate + * presence, but could be removed by UpdateCapabilities(). Emulate * that here for now. */ priv->bonus_caps = gabble_capability_set_new (); #ifdef ENABLE_VOIP @@ -888,7 +874,6 @@ static const gchar *implemented_interfaces[] = { /* always present interfaces */ TP_IFACE_CONNECTION_INTERFACE_POWER_SAVING, TP_IFACE_CONNECTION_INTERFACE_ALIASING, - TP_IFACE_CONNECTION_INTERFACE_CAPABILITIES, TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE, TP_IFACE_CONNECTION_INTERFACE_PRESENCE, TP_IFACE_CONNECTION_INTERFACE_AVATARS, @@ -1312,7 +1297,6 @@ gabble_connection_dispose (GObject *object) g_hash_table_unref (priv->client_caps); gabble_capability_set_free (priv->all_caps); gabble_capability_set_free (priv->notify_caps); - gabble_capability_set_free (priv->legacy_caps); gabble_capability_set_free (priv->sidecar_caps); gabble_capability_set_free (priv->bonus_caps); @@ -2502,7 +2486,6 @@ gabble_connection_refresh_capabilities (GabbleConnection *self, gabble_capability_set_update (self->priv->all_caps, gabble_capabilities_get_fixed_caps ()); gabble_capability_set_update (self->priv->all_caps, self->priv->notify_caps); - gabble_capability_set_update (self->priv->all_caps, self->priv->legacy_caps); gabble_capability_set_update (self->priv->all_caps, self->priv->sidecar_caps); gabble_capability_set_update (self->priv->all_caps, self->priv->bonus_caps); @@ -3133,67 +3116,12 @@ _emit_capabilities_changed (GabbleConnection *conn, const GabbleCapabilitySet *old_set, const GabbleCapabilitySet *new_set) { - GPtrArray *caps_arr; - const CapabilityConversionData *ccd; GHashTable *hash; - guint i; + GPtrArray *caps_arr; if (gabble_capability_set_equals (old_set, new_set)) return; - /* o.f.T.C.Capabilities */ - - caps_arr = g_ptr_array_new (); - - for (ccd = capabilities_conversions; NULL != ccd->iface; ccd++) - { - guint old_specific = ccd->c2tf_fn (old_set); - guint new_specific = ccd->c2tf_fn (new_set); - - if (old_specific != 0 || new_specific != 0) - { - GValue caps_monster_struct = {0, }; - guint old_generic = old_specific ? - TP_CONNECTION_CAPABILITY_FLAG_CREATE | - TP_CONNECTION_CAPABILITY_FLAG_INVITE : 0; - guint new_generic = new_specific ? - TP_CONNECTION_CAPABILITY_FLAG_CREATE | - TP_CONNECTION_CAPABILITY_FLAG_INVITE : 0; - - if (0 == (old_specific ^ new_specific)) - continue; - - g_value_init (&caps_monster_struct, - TP_STRUCT_TYPE_CAPABILITY_CHANGE); - g_value_take_boxed (&caps_monster_struct, - dbus_g_type_specialized_construct - (TP_STRUCT_TYPE_CAPABILITY_CHANGE)); - - dbus_g_type_struct_set (&caps_monster_struct, - 0, handle, - 1, ccd->iface, - 2, old_generic, - 3, new_generic, - 4, old_specific, - 5, new_specific, - G_MAXUINT); - - g_ptr_array_add (caps_arr, g_value_get_boxed (&caps_monster_struct)); - } - } - - if (caps_arr->len) - tp_svc_connection_interface_capabilities_emit_capabilities_changed ( - conn, caps_arr); - - - for (i = 0; i < caps_arr->len; i++) - { - g_boxed_free (TP_STRUCT_TYPE_CAPABILITY_CHANGE, - g_ptr_array_index (caps_arr, i)); - } - g_ptr_array_unref (caps_arr); - /* o.f.T.C.ContactCapabilities */ caps_arr = gabble_connection_build_contact_caps (conn, handle, new_set); @@ -3257,125 +3185,6 @@ connection_capabilities_update_cb (GabblePresenceCache *cache, _emit_capabilities_changed (conn, handle, old_cap_set, new_cap_set); } -/** - * gabble_connection_advertise_capabilities - * - * Implements D-Bus method AdvertiseCapabilities - * on interface org.freedesktop.Telepathy.Connection.Interface.Capabilities - * - * @error: Used to return a pointer to a GError detailing any error - * that occurred, D-Bus will throw the error only if this - * function returns FALSE. - * - * Returns: TRUE if successful, FALSE if an error was thrown. - */ -static void -gabble_connection_advertise_capabilities (TpSvcConnectionInterfaceCapabilities *iface, - const GPtrArray *add, - const gchar **del, - DBusGMethodInvocation *context) -{ - GabbleConnection *self = GABBLE_CONNECTION (iface); - TpBaseConnection *base = (TpBaseConnection *) self; - guint i; - GabbleConnectionPrivate *priv = self->priv; - const CapabilityConversionData *ccd; - GPtrArray *ret; - GabbleCapabilitySet *save_set; - GabbleCapabilitySet *add_set, *remove_set; - - TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context); - - /* Now that someone has told us our *actual* capabilities, we can stop - * advertising spurious caps in initial presence */ - gabble_capability_set_clear (self->priv->bonus_caps); - - add_set = gabble_capability_set_new (); - remove_set = gabble_capability_set_new (); - - for (i = 0; i < add->len; i++) - { - GValue iface_flags_pair = {0, }; - gchar *channel_type; - guint flags; - - g_value_init (&iface_flags_pair, TP_STRUCT_TYPE_CAPABILITY_PAIR); - g_value_set_static_boxed (&iface_flags_pair, g_ptr_array_index (add, i)); - - dbus_g_type_struct_get (&iface_flags_pair, - 0, &channel_type, - 1, &flags, - G_MAXUINT); - - for (ccd = capabilities_conversions; NULL != ccd->iface; ccd++) - if (g_str_equal (channel_type, ccd->iface)) - ccd->tf2c_fn (flags, add_set); - - g_free (channel_type); - } - - for (i = 0; NULL != del[i]; i++) - { - for (ccd = capabilities_conversions; NULL != ccd->iface; ccd++) - if (g_str_equal (del[i], ccd->iface)) - ccd->tf2c_fn (~0, remove_set); - } - - gabble_capability_set_update (priv->legacy_caps, add_set); - gabble_capability_set_exclude (priv->legacy_caps, remove_set); - - if (DEBUGGING) - { - gchar *add_str = gabble_capability_set_dump (add_set, " "); - gchar *remove_str = gabble_capability_set_dump (remove_set, " "); - - DEBUG ("caps to add:\n%s", add_str); - DEBUG ("caps to remove:\n%s", remove_str); - g_free (add_str); - g_free (remove_str); - } - - gabble_capability_set_free (add_set); - gabble_capability_set_free (remove_set); - - if (gabble_connection_refresh_capabilities (self, &save_set)) - { - _emit_capabilities_changed (self, - tp_base_connection_get_self_handle (base), save_set, priv->all_caps); - gabble_capability_set_free (save_set); - } - - ret = g_ptr_array_new (); - - for (ccd = capabilities_conversions; NULL != ccd->iface; ccd++) - { - guint tp_caps = ccd->c2tf_fn (self->priv->all_caps); - - if (tp_caps != 0) - { - GValue iface_flags_pair = {0, }; - - g_value_init (&iface_flags_pair, TP_STRUCT_TYPE_CAPABILITY_PAIR); - g_value_take_boxed (&iface_flags_pair, - dbus_g_type_specialized_construct ( - TP_STRUCT_TYPE_CAPABILITY_PAIR)); - - dbus_g_type_struct_set (&iface_flags_pair, - 0, ccd->iface, - 1, tp_caps, - G_MAXUINT); - - g_ptr_array_add (ret, g_value_get_boxed (&iface_flags_pair)); - } - } - - tp_svc_connection_interface_capabilities_return_from_advertise_capabilities ( - context, ret); - - g_ptr_array_foreach (ret, (GFunc) g_value_array_free, NULL); - g_ptr_array_unref (ret); -} - static const gchar * get_form_type (WockyDataForm *form) { @@ -3614,126 +3423,6 @@ gabble_connection_update_capabilities ( context); } -static const gchar *assumed_caps[] = -{ - TP_IFACE_CHANNEL_TYPE_TEXT, - NULL -}; - - -/** - * gabble_connection_get_handle_capabilities - * - * Add capabilities of handle to the given GPtrArray - */ -static void -gabble_connection_get_handle_capabilities (GabbleConnection *self, - TpHandle handle, GPtrArray *arr) -{ - TpBaseConnection *base = (TpBaseConnection *) self; - GabblePresence *pres; - const CapabilityConversionData *ccd; - guint typeflags; - const gchar **assumed; - - if (0 == handle) - { - /* obsolete request for the connection's capabilities, do nothing */ - return; - } - - if (handle == tp_base_connection_get_self_handle (base)) - pres = self->self_presence; - else - pres = gabble_presence_cache_get (self->presence_cache, handle); - - if (NULL != pres) - { - const GabbleCapabilitySet *cap_set = gabble_presence_peek_caps (pres); - - for (ccd = capabilities_conversions; NULL != ccd->iface; ccd++) - { - typeflags = ccd->c2tf_fn (cap_set); - - if (typeflags) - { - GValue monster = {0, }; - - g_value_init (&monster, TP_STRUCT_TYPE_CONTACT_CAPABILITY); - g_value_take_boxed (&monster, - dbus_g_type_specialized_construct ( - TP_STRUCT_TYPE_CONTACT_CAPABILITY)); - - dbus_g_type_struct_set (&monster, - 0, handle, - 1, ccd->iface, - 2, TP_CONNECTION_CAPABILITY_FLAG_CREATE | - TP_CONNECTION_CAPABILITY_FLAG_INVITE, - 3, typeflags, - G_MAXUINT); - - g_ptr_array_add (arr, g_value_get_boxed (&monster)); - } - } - } - - for (assumed = assumed_caps; NULL != *assumed; assumed++) - { - GValue monster = {0, }; - - g_value_init (&monster, TP_STRUCT_TYPE_CONTACT_CAPABILITY); - g_value_take_boxed (&monster, - dbus_g_type_specialized_construct ( - TP_STRUCT_TYPE_CONTACT_CAPABILITY)); - - dbus_g_type_struct_set (&monster, - 0, handle, - 1, *assumed, - 2, TP_CONNECTION_CAPABILITY_FLAG_CREATE | - TP_CONNECTION_CAPABILITY_FLAG_INVITE, - 3, 0, - G_MAXUINT); - - g_ptr_array_add (arr, g_value_get_boxed (&monster)); - } -} - - -static void -conn_capabilities_fill_contact_attributes (GObject *obj, - const GArray *contacts, GHashTable *attributes_hash) -{ - GabbleConnection *self = GABBLE_CONNECTION (obj); - guint i; - GPtrArray *array = NULL; - - for (i = 0; i < contacts->len; i++) - { - TpHandle handle = g_array_index (contacts, TpHandle, i); - - if (array == NULL) - array = g_ptr_array_new (); - - gabble_connection_get_handle_capabilities (self, handle, array); - - if (array->len > 0) - { - GValue *val = tp_g_value_slice_new ( - TP_ARRAY_TYPE_CONTACT_CAPABILITY_LIST); - - g_value_take_boxed (val, array); - tp_contacts_mixin_set_contact_attribute (attributes_hash, - handle, TP_IFACE_CONNECTION_INTERFACE_CAPABILITIES"/caps", - val); - - array = NULL; - } - } - - if (array != NULL) - g_ptr_array_unref (array); -} - static void conn_contact_capabilities_fill_contact_attributes (GObject *obj, const GArray *contacts, GHashTable *attributes_hash) @@ -3756,54 +3445,6 @@ conn_contact_capabilities_fill_contact_attributes (GObject *obj, } /** - * gabble_connection_get_capabilities - * - * Implements D-Bus method GetCapabilities - * on interface org.freedesktop.Telepathy.Connection.Interface.Capabilities - */ -static void -gabble_connection_get_capabilities (TpSvcConnectionInterfaceCapabilities *iface, - const GArray *handles, - DBusGMethodInvocation *context) -{ - GabbleConnection *self = GABBLE_CONNECTION (iface); - TpBaseConnection *base = (TpBaseConnection *) self; - TpHandleRepoIface *contact_handles = tp_base_connection_get_handles (base, - TP_HANDLE_TYPE_CONTACT); - guint i; - GPtrArray *ret; - GError *error = NULL; - - TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context); - - if (!tp_handles_are_valid (contact_handles, handles, TRUE, &error)) - { - dbus_g_method_return_error (context, error); - g_error_free (error); - return; - } - - ret = g_ptr_array_new (); - - for (i = 0; i < handles->len; i++) - { - TpHandle handle = g_array_index (handles, TpHandle, i); - - gabble_connection_get_handle_capabilities (self, handle, ret); - } - - tp_svc_connection_interface_capabilities_return_from_get_capabilities ( - context, ret); - - for (i = 0; i < ret->len; i++) - { - g_value_array_free (g_ptr_array_index (ret, i)); - } - - g_ptr_array_unref (ret); -} - -/** * gabble_connection_get_contact_capabilities * * Implements D-Bus method GetContactCapabilities @@ -3934,19 +3575,6 @@ gabble_connection_send_presence (GabbleConnection *conn, } static void -capabilities_service_iface_init (gpointer g_iface, gpointer iface_data) -{ - TpSvcConnectionInterfaceCapabilitiesClass *klass = - (TpSvcConnectionInterfaceCapabilitiesClass *) g_iface; - -#define IMPLEMENT(x) tp_svc_connection_interface_capabilities_implement_##x (\ - klass, gabble_connection_##x) - IMPLEMENT(advertise_capabilities); - IMPLEMENT(get_capabilities); -#undef IMPLEMENT -} - -static void gabble_conn_contact_caps_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcConnectionInterfaceContactCapabilitiesClass *klass = g_iface; diff --git a/src/legacy-caps.c b/src/legacy-caps.c deleted file mode 100644 index 827fc15..0000000 --- a/src/legacy-caps.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * legacy-caps.c - Connection.Interface.Capabilities constants and utilities - * Copyright (C) 2005 Collabora Ltd. - * Copyright (C) 2005 Nokia Corporation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "config.h" -#include "legacy-caps.h" - -#include - -#define DEBUG_FLAG GABBLE_DEBUG_PRESENCE -#include "debug.h" -#ifdef ENABLE_VOIP -#include "media-factory.h" -#endif - -const CapabilityConversionData capabilities_conversions[] = -{ -#ifdef ENABLE_VOIP - { TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA, - _gabble_media_factory_typeflags_to_caps, - _gabble_media_factory_caps_to_typeflags }, -#endif - { NULL, NULL, NULL} -}; diff --git a/src/legacy-caps.h b/src/legacy-caps.h deleted file mode 100644 index e2de46c..0000000 --- a/src/legacy-caps.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * legacy-caps.h - Connection.Interface.Capabilities constants and utilities - * Copyright (C) 2005 Collabora Ltd. - * Copyright (C) 2005 Nokia Corporation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef __GABBLE_LEGACY_CAPS__H__ -#define __GABBLE_LEGACY_CAPS__H__ - -#include - -#include "gabble/capabilities.h" - -typedef void (*TypeFlagsToCapsFunc) (guint typeflags, GabbleCapabilitySet *caps); -typedef guint (*CapsToTypeFlagsFunc) (const GabbleCapabilitySet *caps); - -typedef struct _CapabilityConversionData CapabilityConversionData; - -struct _CapabilityConversionData -{ - const gchar *iface; - TypeFlagsToCapsFunc tf2c_fn; - CapsToTypeFlagsFunc c2tf_fn; -}; - -extern const CapabilityConversionData capabilities_conversions[]; - -#endif diff --git a/tests/twisted/Makefile.am b/tests/twisted/Makefile.am index d93d5b3..898d508 100644 --- a/tests/twisted/Makefile.am +++ b/tests/twisted/Makefile.am @@ -2,7 +2,6 @@ TWISTED_TESTS = \ addressing.py \ avatar-requirements.py \ caps/advertise-contact-caps.py \ - caps/advertise-legacy.py \ caps/broken-reply.py \ caps/caps-cache.py \ caps/caps-persistent-cache.py \ diff --git a/tests/twisted/caps/advertise-legacy.py b/tests/twisted/caps/advertise-legacy.py deleted file mode 100644 index 95b1624..0000000 --- a/tests/twisted/caps/advertise-legacy.py +++ /dev/null @@ -1,110 +0,0 @@ -""" -Test AdvertiseCapabilities. -""" - -import dbus - -from twisted.words.xish import xpath, domish - -from servicetest import EventPattern -from gabbletest import exec_test -from caps_helper import caps_contain, receive_presence_and_ask_caps,\ - check_caps, JINGLE_CAPS -import constants as cs -import ns - -from config import VOIP_ENABLED - -if not VOIP_ENABLED: - print "NOTE: built with --disable-voip" - raise SystemExit(77) - -def run_test(q, bus, conn, stream): - initial_presence = q.expect('stream-presence') - - # This method call looks wrong, but it's "the other side" of - # test/twisted/capabilities/legacy-caps.py in MC 5.1 - MC doesn't know - # how to map Client capabilities into the old Capabilities interface. - # - # Also, MC sometimes puts the same channel type in the list twice, so - # make sure Gabble copes. - add = [(cs.CHANNEL_TYPE_STREAMED_MEDIA, 2L**32-1), - (cs.CHANNEL_TYPE_STREAM_TUBE, 2L**32-1), - (cs.CHANNEL_TYPE_STREAM_TUBE, 2L**32-1)] - remove = [] - caps = conn.Capabilities.AdvertiseCapabilities(add, remove) - (disco_response, namespaces, _, _) = receive_presence_and_ask_caps(q, stream, - False) - check_caps(namespaces, JINGLE_CAPS) - - # Remove all our caps again - add = [] - remove = [cs.CHANNEL_TYPE_STREAMED_MEDIA, - cs.CHANNEL_TYPE_STREAM_TUBE] - caps = conn.Capabilities.AdvertiseCapabilities(add, remove) - (disco_response, namespaces, _, _) = receive_presence_and_ask_caps(q, stream, - False) - check_caps(namespaces, []) - - # Add caps selectively (i.e. what a client that actually understood the - # old Capabilities interface would do). With AUDIO and GTALK_P2P, we're - # callable, but not via ICE-UDP, and not with video. - # - # (Jingle and raw UDP need no special client support, so are automatically - # enabled whenever we can do audio or video.) - add = [(cs.CHANNEL_TYPE_STREAMED_MEDIA, - cs.MEDIA_CAP_AUDIO | cs.MEDIA_CAP_GTALKP2P)] - remove = [] - caps = conn.Capabilities.AdvertiseCapabilities(add, remove) - (disco_response, namespaces, _, _) = receive_presence_and_ask_caps(q, stream, - False) - check_caps(namespaces, - [ns.GOOGLE_P2P, ns.JINGLE_TRANSPORT_RAWUDP, ns.JINGLE, - ns.JINGLE_015, ns.GOOGLE_FEAT_VOICE, ns.JINGLE_RTP_AUDIO, - ns.JINGLE_RTP, ns.JINGLE_015_AUDIO]) - - # Remove all our caps again - add = [] - remove = [cs.CHANNEL_TYPE_STREAMED_MEDIA, - cs.CHANNEL_TYPE_STREAM_TUBE] - caps = conn.Capabilities.AdvertiseCapabilities(add, remove) - (disco_response, namespaces, _, _) = receive_presence_and_ask_caps(q, stream, - False) - check_caps(namespaces, []) - - # With AUDIO but no transport, we are only callable via raw UDP, which - # Google clients cannot do. - add = [(cs.CHANNEL_TYPE_STREAMED_MEDIA, cs.MEDIA_CAP_AUDIO)] - remove = [] - caps = conn.Capabilities.AdvertiseCapabilities(add, remove) - (disco_response, namespaces, _, _) = receive_presence_and_ask_caps(q, stream, - False) - check_caps(namespaces, - [ns.JINGLE_TRANSPORT_RAWUDP, ns.JINGLE, - ns.JINGLE_015, ns.JINGLE_RTP_AUDIO, - ns.JINGLE_RTP, ns.JINGLE_015_AUDIO]) - - # Remove all our caps again - add = [] - remove = [cs.CHANNEL_TYPE_STREAMED_MEDIA, - cs.CHANNEL_TYPE_STREAM_TUBE] - caps = conn.Capabilities.AdvertiseCapabilities(add, remove) - (disco_response, namespaces, _, _) = receive_presence_and_ask_caps(q, stream, - False) - check_caps(namespaces, []) - - # With VIDEO and ICE-UDP only, we are very futuristic indeed. - # Google clients cannot interop with us. - add = [(cs.CHANNEL_TYPE_STREAMED_MEDIA, - cs.MEDIA_CAP_VIDEO | cs.MEDIA_CAP_ICEUDP)] - remove = [] - caps = conn.Capabilities.AdvertiseCapabilities(add, remove) - (disco_response, namespaces, _, _) = receive_presence_and_ask_caps(q, stream, - False) - check_caps(namespaces, - [ns.JINGLE_TRANSPORT_ICEUDP, ns.JINGLE_TRANSPORT_RAWUDP, ns.JINGLE, - ns.JINGLE_015, ns.JINGLE_RTP_VIDEO, - ns.JINGLE_RTP, ns.JINGLE_015_VIDEO]) - -if __name__ == '__main__': - exec_test(run_test) diff --git a/tests/twisted/caps/caps-cache.py b/tests/twisted/caps/caps-cache.py index aea8bc2..b443bd9 100644 --- a/tests/twisted/caps/caps-cache.py +++ b/tests/twisted/caps/caps-cache.py @@ -32,22 +32,17 @@ features = [ def expect_caps(q, conn, h): # we can now do audio and video calls - old, new = q.expect_many( - EventPattern('dbus-signal', signal='CapabilitiesChanged'), + cc, = q.expect_many( EventPattern('dbus-signal', signal='ContactCapabilitiesChanged', predicate=lambda e: h in e.args[0]), ) - assert_rccs_callable(new.args[0][h], require_video=True) + assert_rccs_callable(cc.args[0][h], require_video=True) check_caps(conn, h) def check_caps(conn, h): caps = conn.ContactCapabilities.GetContactCapabilities([h]) assert_rccs_callable(caps[h], require_video=True) - assertContains((h, cs.CHANNEL_TYPE_STREAMED_MEDIA, 3, - cs.MEDIA_CAP_AUDIO | cs.MEDIA_CAP_VIDEO), - conn.Capabilities.GetCapabilities([h])) - def update_contact_caps(q, conn, stream, contact, caps, disco = True, dataforms = {}, initial = True): h = presence_and_disco (q, conn, stream, contact, diff --git a/tests/twisted/caps/caps-persistent-cache.py b/tests/twisted/caps/caps-persistent-cache.py index 0d418fe..c62f84e 100644 --- a/tests/twisted/caps/caps-persistent-cache.py +++ b/tests/twisted/caps/caps-persistent-cache.py @@ -47,10 +47,6 @@ def handle_disco(q, stream, contact_jid, identity): send_disco_reply(stream, event.stanza, [identity], features) def capabilities_changed(q, contact_handle): - streamed_media_caps = (contact_handle, cs.CHANNEL_TYPE_STREAMED_MEDIA, - 0, 3, 0, cs.MEDIA_CAP_AUDIO | cs.MEDIA_CAP_VIDEO) - e = q.expect('dbus-signal', signal='CapabilitiesChanged') - assertContains(streamed_media_caps, e.args[0]) e = q.expect('dbus-signal', signal='ContactCapabilitiesChanged') assertContains(contact_handle, e.args[0]) assert_rccs_callable(e.args[0][contact_handle], require_video=True) diff --git a/tests/twisted/caps/from-bare-jid.py b/tests/twisted/caps/from-bare-jid.py index c0d5234..e56e022 100644 --- a/tests/twisted/caps/from-bare-jid.py +++ b/tests/twisted/caps/from-bare-jid.py @@ -50,14 +50,10 @@ def test(q, bus, conn, stream): # Gabble lets us know their caps have changed. (Gabble used to ignore the # reply.) - old, new = q.expect_many( - EventPattern('dbus-signal', signal='CapabilitiesChanged'), + cc, = q.expect_many( EventPattern('dbus-signal', signal='ContactCapabilitiesChanged'), ) - streamed_media_caps = (contact_handle, cs.CHANNEL_TYPE_STREAMED_MEDIA, - 0, 3, 0, cs.MEDIA_CAP_AUDIO | cs.MEDIA_CAP_VIDEO) - assertContains(streamed_media_caps, old.args[0]) - assert_rccs_callable(new.args[0][contact_handle]) + assert_rccs_callable(cc.args[0][contact_handle]) # Gabble gets another presence stanza from the bare JID, with different # caps. @@ -88,15 +84,13 @@ def test(q, bus, conn, stream): # Gabble throws away presence from the bare JID when it gets presence from # a resource (and vice versa), so it should now say the contact is # incapable. Gabble also looks up the resourceful JID's hash. - old, new, disco3 = q.expect_many( - EventPattern('dbus-signal', signal='CapabilitiesChanged'), + cc, disco3 = q.expect_many( EventPattern('dbus-signal', signal='ContactCapabilitiesChanged'), EventPattern('stream-iq', to=contact_with_resource, query_ns='http://jabber.org/protocol/disco#info'), ) - assertDoesNotContain(streamed_media_caps, old.args[0]) - assert_rccs_not_callable(new.args[0][contact_handle]) + assert_rccs_not_callable(cc.args[0][contact_handle]) query_node = xpath.queryForNodes('/iq/query', disco3.stanza)[0] assertEquals(client + '#' + caps['ver'], query_node.attributes['node']) @@ -110,14 +104,10 @@ def test(q, bus, conn, stream): send_disco_reply(stream, disco3.stanza, [], features_) # Gabble should announce that the contact has acquired some caps. - old, new = q.expect_many( - EventPattern('dbus-signal', signal='CapabilitiesChanged'), + cc, = q.expect_many( EventPattern('dbus-signal', signal='ContactCapabilitiesChanged'), ) - streamed_media_caps = (contact_handle, cs.CHANNEL_TYPE_STREAMED_MEDIA, - 0, 3, 0, cs.MEDIA_CAP_AUDIO | cs.MEDIA_CAP_VIDEO) - assertContains(streamed_media_caps, old.args[0]) - assert_rccs_callable(new.args[0][contact_handle]) + assert_rccs_callable(cc.args[0][contact_handle]) if __name__ == '__main__': exec_test(test) diff --git a/tests/twisted/caps/hashed-caps.py b/tests/twisted/caps/hashed-caps.py index 5f612d9..11f7374 100644 --- a/tests/twisted/caps/hashed-caps.py +++ b/tests/twisted/caps/hashed-caps.py @@ -5,13 +5,13 @@ Test the verification string introduced in version 1.5 of XEP-0115 This test changes the caps several times: - Initial presence to be online - Change presence to handle audio calls, using XEP-0115-v1.3. Check that - 'CapabilitiesChanged' *is* fired + 'ContactCapabilitiesChanged' *is* fired - Change presence *not* to handle audio calls, using XEP-0115-v1.5, but with a - *bogus* hash. Check that 'CapabilitiesChanged' is *not* fired + *bogus* hash. Check that 'ContactCapabilitiesChanged' is *not* fired - Change presence *not* to handle audio calls, using XEP-0115-v1.5, with a - *good* hash. Check that 'CapabilitiesChanged' *is* fired + *good* hash. Check that 'ContactCapabilitiesChanged' *is* fired - Change presence to handle audio calls, using XEP-0115-v1.5, with a XEP-0128 - dataform. Check that 'CapabilitiesChanged' is fired + dataform. Check that 'ContactCapabilitiesChanged' is fired This is done for 2 contacts Then, this test announce 2 contacts with the same hash. @@ -60,8 +60,6 @@ def test_hash(q, bus, conn, stream, contact, contact_handle, client): (2, u'available', 'hello')}]) # no special capabilities - basic_caps = [(contact_handle, cs.CHANNEL_TYPE_TEXT, 3, 0)] - assert conn.Capabilities.GetCapabilities([contact_handle]) == basic_caps for rcc in conn.ContactCapabilities.GetContactCapabilities([contact_handle])[contact_handle]: assertEquals(cs.CHANNEL_TYPE_TEXT, rcc[0].get(cs.CHANNEL_TYPE)) @@ -83,18 +81,12 @@ def test_hash(q, bus, conn, stream, contact, contact_handle, client): send_disco_reply(stream, event.stanza, [], jingle_av_features) # we can now do audio calls - old, new = q.expect_many( - EventPattern('dbus-signal', signal='CapabilitiesChanged'), + cc, = q.expect_many( EventPattern('dbus-signal', signal='ContactCapabilitiesChanged'), ) - caps_diff = old.args[0] - media_diff = [c for c in caps_diff - if c[1] == cs.CHANNEL_TYPE_STREAMED_MEDIA][0] - assert media_diff[5] & cs.MEDIA_CAP_AUDIO, media_diff[5] - - assert_rccs_callable(new.args[0][contact_handle]) - assertEquals(new.args[0], + assert_rccs_callable(cc.args[0][contact_handle]) + assertEquals(cc.args[0], conn.ContactCapabilities.GetContactCapabilities([contact_handle])) # Send presence without any capabilities. XEP-0115 ยง8.4 Caps Optimization @@ -104,12 +96,8 @@ def test_hash(q, bus, conn, stream, contact, contact_handle, client): stream.send(make_presence(contact, status='very capable')) q.expect('dbus-signal', signal='PresencesChanged', args=[{contact_handle: (2, u'available', 'very capable')}]) - ye_olde_caps = conn.Capabilities.GetCapabilities([contact_handle]) - assertLength(1, [c for c in ye_olde_caps - if c[1] == cs.CHANNEL_TYPE_STREAMED_MEDIA and - c[3] & cs.MEDIA_CAP_AUDIO]) # still exactly the same capabilities - assertEquals(new.args[0], + assertEquals(cc.args[0], conn.ContactCapabilities.GetContactCapabilities([contact_handle])) # send bogus presence @@ -134,7 +122,6 @@ def test_hash(q, bus, conn, stream, contact, contact_handle, client): # don't receive any D-Bus signal forbidden = [ - EventPattern('dbus-signal', signal='CapabilitiesChanged'), EventPattern('dbus-signal', signal='ContactCapabilitiesChanged'), ] q.forbid_events(forbidden) @@ -165,14 +152,13 @@ def test_hash(q, bus, conn, stream, contact, contact_handle, client): stream.send(result) # we can now do nothing - old, new = q.expect_many( - EventPattern('dbus-signal', signal='CapabilitiesChanged'), + cc, = q.expect_many( EventPattern('dbus-signal', signal='ContactCapabilitiesChanged'), ) - for rcc in new.args[0][contact_handle]: + for rcc in cc.args[0][contact_handle]: assertEquals(cs.CHANNEL_TYPE_TEXT, rcc[0].get(cs.CHANNEL_TYPE)) - assert_rccs_not_callable(new.args[0][contact_handle]) - assertEquals(new.args[0], + assert_rccs_not_callable(cc.args[0][contact_handle]) + assertEquals(cc.args[0], conn.ContactCapabilities.GetContactCapabilities([contact_handle])) # send correct presence @@ -202,12 +188,11 @@ def test_hash(q, bus, conn, stream, contact, contact_handle, client): stream, event.stanza, some_identities, jingle_av_features, fake_client_dataforms) # we can now do audio calls - old, new = q.expect_many( - EventPattern('dbus-signal', signal='CapabilitiesChanged'), + cc, = q.expect_many( EventPattern('dbus-signal', signal='ContactCapabilitiesChanged'), ) - assert_rccs_callable(new.args[0][contact_handle]) - assertEquals(new.args[0], + assert_rccs_callable(cc.args[0][contact_handle]) + assertEquals(cc.args[0], conn.ContactCapabilities.GetContactCapabilities([contact_handle])) def test_two_clients(q, bus, conn, stream, contact1, contact2, @@ -228,11 +213,6 @@ def test_two_clients(q, bus, conn, stream, contact1, contact2, (2, u'available', 'hello')}]) # no special capabilities - basic_caps = [(contact_handle1, cs.CHANNEL_TYPE_TEXT, 3, 0)] - assert conn.Capabilities.GetCapabilities([contact_handle1]) == basic_caps - basic_caps = [(contact_handle2, cs.CHANNEL_TYPE_TEXT, 3, 0)] - assert conn.Capabilities.GetCapabilities([contact_handle2]) == basic_caps - for h in (contact_handle1, contact_handle2): for rcc in conn.ContactCapabilities.GetContactCapabilities([h])[h]: assertEquals(cs.CHANNEL_TYPE_TEXT, rcc[0].get(cs.CHANNEL_TYPE)) @@ -258,7 +238,6 @@ def test_two_clients(q, bus, conn, stream, contact1, contact2, # don't receive any D-Bus signal forbidden = [ - EventPattern('dbus-signal', signal='CapabilitiesChanged'), EventPattern('dbus-signal', signal='ContactCapabilitiesChanged'), ] q.forbid_events(forbidden) @@ -293,26 +272,20 @@ def test_two_clients(q, bus, conn, stream, contact1, contact2, send_disco_reply(stream, event.stanza, some_identities, jingle_av_features) # we can now do audio calls - old, new = q.expect_many( - EventPattern('dbus-signal', signal='CapabilitiesChanged', - args=[[(contact_handle2, cs.CHANNEL_TYPE_STREAMED_MEDIA, 0, 3, 0, - cs.MEDIA_CAP_AUDIO | cs.MEDIA_CAP_VIDEO)]]), + cc, = q.expect_many( EventPattern('dbus-signal', signal='ContactCapabilitiesChanged', predicate=lambda e: contact_handle2 in e.args[0]), ) - assert_rccs_callable(new.args[0][contact_handle2]) + assert_rccs_callable(cc.args[0][contact_handle2]) if not broken_hash: # if the first contact failed to provide a good hash, it does not # deserve its capabilities to be understood by Gabble! - old, new = q.expect_many( - EventPattern('dbus-signal', signal='CapabilitiesChanged', - args=[[(contact_handle1, cs.CHANNEL_TYPE_STREAMED_MEDIA, 0, 3, 0, - cs.MEDIA_CAP_AUDIO | cs.MEDIA_CAP_VIDEO)]]), + cc, = q.expect_many( EventPattern('dbus-signal', signal='ContactCapabilitiesChanged', predicate=lambda e: contact_handle1 in e.args[0]), ) - assert_rccs_callable(new.args[0][contact_handle1]) + assert_rccs_callable(cc.args[0][contact_handle1]) # don't receive any further signals q.forbid_events(forbidden) diff --git a/tests/twisted/caps/jingle-caps.py b/tests/twisted/caps/jingle-caps.py index 42f69cf..8cbedb3 100644 --- a/tests/twisted/caps/jingle-caps.py +++ b/tests/twisted/caps/jingle-caps.py @@ -68,21 +68,10 @@ def test_caps(q, conn, stream, contact, features, audio, video, google=False): else: call_expected_media_caps.append(cs.CALL_MUTABLE_CONTENTS) - _, event = q.expect_many( - EventPattern('dbus-signal', signal='CapabilitiesChanged', - args = [[ ( h, - cs.CHANNEL_TYPE_STREAMED_MEDIA, - 0, # old generic - 3, # new generic (can create and receive these) - 0, # old specific - cflags ) ]] # new specific - ), + event, = q.expect_many( EventPattern('dbus-signal', signal='ContactCapabilitiesChanged') ) - assertContains((h, cs.CHANNEL_TYPE_STREAMED_MEDIA, 3, cflags), - conn.Capabilities.GetCapabilities([h])) - # Check Contact capabilities for streamed media assertEquals(len(event.args), 1) assertEquals (event.args[0], diff --git a/tests/twisted/caps/offline.py b/tests/twisted/caps/offline.py index 1313c6d..0d46055 100644 --- a/tests/twisted/caps/offline.py +++ b/tests/twisted/caps/offline.py @@ -40,13 +40,5 @@ def test(q, bus, conn, stream): cs.TARGET_HANDLE_TYPE: cs.HT_CONTACT}, fixed) assertSameSets([cs.TARGET_HANDLE], allowed) - # old Capabilities - all_caps = conn.Capabilities.GetCapabilities([bob_handle]) - assertLength(1, all_caps) - - caps = all_caps[0] - - assertEquals((bob_handle, cs.CHANNEL_TYPE_TEXT, 3, 0), caps) - if __name__ == '__main__': exec_test(test, do_connect=False) diff --git a/tests/twisted/caps/receive-jingle.py b/tests/twisted/caps/receive-jingle.py index cb67712..80ceec7 100644 --- a/tests/twisted/caps/receive-jingle.py +++ b/tests/twisted/caps/receive-jingle.py @@ -16,8 +16,6 @@ if not VOIP_ENABLED: print "NOTE: built with --disable-voip" raise SystemExit(77) -icaps_attr = cs.CONN_IFACE_CAPS + "/caps" - def test(q, bus, conn, stream): bob, = conn.RequestHandles(cs.HT_CONTACT, ['bob@foo.com']) @@ -29,17 +27,11 @@ def test(q, bus, conn, stream): basic_caps = [(bob, cs.CHANNEL_TYPE_TEXT, 3, 0)] - # no special capabilities - assert conn.Capabilities.GetCapabilities([bob]) == basic_caps # only Text for rcc in conn.ContactCapabilities.GetContactCapabilities([bob])[bob]: assertEquals(cs.CHANNEL_TYPE_TEXT, rcc[0].get(cs.CHANNEL_TYPE)) # holding the handle here: see below - assert conn.Contacts.GetContactAttributes( - [bob], [cs.CONN_IFACE_CAPS], True) == \ - { bob: { icaps_attr: basic_caps, - cs.CONN + '/contact-id': 'bob@foo.com'}} assertEquals( { bob: { cs.ATTR_CONTACT_CAPABILITIES: @@ -90,27 +82,17 @@ def test(q, bus, conn, stream): stream.send(result) # we can now do audio and video calls - old, new = q.expect_many( - EventPattern('dbus-signal', signal='CapabilitiesChanged', - args=[[(bob, cs.CHANNEL_TYPE_STREAMED_MEDIA, 0, 3, - 0, cs.MEDIA_CAP_AUDIO | cs.MEDIA_CAP_VIDEO)]]), + cc, = q.expect_many( EventPattern('dbus-signal', signal='ContactCapabilitiesChanged', predicate=lambda e: check_rccs_callable(e.args[0][bob])), ) - assert_rccs_callable(new.args[0][bob], require_video=True, + assert_rccs_callable(cc.args[0][bob], require_video=True, mutable_contents=True) - caps = conn.Contacts.GetContactAttributes([bob], [cs.CONN_IFACE_CAPS], False) - assert caps.keys() == [bob] - assert icaps_attr in caps[bob] - assert len(caps[bob][icaps_attr]) == 2 - assert basic_caps[0] in caps[bob][icaps_attr] - assert (bob, cs.CHANNEL_TYPE_STREAMED_MEDIA, 3, 3) in caps[bob][icaps_attr] - assertEquals( { bob: { cs.ATTR_CONTACT_CAPABILITIES: - new.args[0][bob], + cc.args[0][bob], cs.CONN + '/contact-id': 'bob@foo.com', }, }, @@ -127,30 +109,17 @@ def test(q, bus, conn, stream): # we can now do only audio calls (and as a result have the ImmutableStreams # cap) - old, new = q.expect_many( - EventPattern('dbus-signal', signal='CapabilitiesChanged', - args=[[(bob, cs.CHANNEL_TYPE_STREAMED_MEDIA, 3, 3, - cs.MEDIA_CAP_AUDIO | cs.MEDIA_CAP_VIDEO, - cs.MEDIA_CAP_AUDIO | cs.MEDIA_CAP_IMMUTABLE_STREAMS)]]), + cc, = q.expect_many( EventPattern('dbus-signal', signal='ContactCapabilitiesChanged'), ) - assert_rccs_callable(new.args[0][bob]) - assert_rccs_not_callable(new.args[0][bob], require_audio=False, + assert_rccs_callable(cc.args[0][bob]) + assert_rccs_not_callable(cc.args[0][bob], require_audio=False, require_video=True, mutable_contents=False) - caps = conn.Contacts.GetContactAttributes([bob], [cs.CONN_IFACE_CAPS], False) - assert caps.keys() == [bob] - assert icaps_attr in caps[bob] - assert len(caps[bob][icaps_attr]) == 2 - assert basic_caps[0] in caps[bob][icaps_attr] - assert (bob, cs.CHANNEL_TYPE_STREAMED_MEDIA, 3, - cs.MEDIA_CAP_AUDIO | cs.MEDIA_CAP_IMMUTABLE_STREAMS) \ - in caps[bob][icaps_attr] - assertEquals( { bob: { cs.ATTR_CONTACT_CAPABILITIES: - new.args[0][bob], + cc.args[0][bob], cs.CONN + '/contact-id': 'bob@foo.com', }, }, @@ -163,11 +132,6 @@ def test(q, bus, conn, stream): # can't do audio calls any more q.expect_many( - EventPattern('dbus-signal', signal='CapabilitiesChanged', - args=[[(bob, cs.CHANNEL_TYPE_STREAMED_MEDIA, 3, 0, - cs.MEDIA_CAP_AUDIO | cs.MEDIA_CAP_IMMUTABLE_STREAMS, - 0)]], - ), EventPattern('dbus-signal', signal='PresencesChanged', args=[{bob: (cs.PRESENCE_OFFLINE, 'offline', '')}]), EventPattern('dbus-signal', signal='ContactCapabilitiesChanged'), @@ -189,22 +153,10 @@ def test(q, bus, conn, stream): }, conn.Contacts.GetContactAttributes([bob], [cs.CONN_IFACE_CONTACT_CAPS], True)) - assert conn.Contacts.GetContactAttributes( - [bob], [cs.CONN_IFACE_CAPS], False) == \ - { bob: { icaps_attr: basic_caps, - cs.CONN + '/contact-id': 'bob@foo.com'}} # What about a handle that's not valid? assertEquals({}, conn.Contacts.GetContactAttributes( - [31337], [cs.CONN_IFACE_CAPS], False)) - - # regression test for fd.o #15198: getting caps of invalid handle crashed - try: - conn.Capabilities.GetCapabilities([31337]) - except dbus.DBusException, e: - pass - else: - assert False, "Should have had an error!" + [31337], [cs.CONN_IFACE_CONTACT_CAPS], False)) if __name__ == '__main__': exec_test(test) diff --git a/tests/twisted/caps_helper.py b/tests/twisted/caps_helper.py index f096038..7e71c55 100644 --- a/tests/twisted/caps_helper.py +++ b/tests/twisted/caps_helper.py @@ -326,9 +326,6 @@ def send_presence(q, conn, stream, contact, caps, initial=True, show=None): (2, u'available', 'hello')}]) # no special capabilities - assertEquals([(h, cs.CHANNEL_TYPE_TEXT, 3, 0)], - conn.Capabilities.GetCapabilities([h])) - for rcc in conn.ContactCapabilities.GetContactCapabilities([h])[h]: assertEquals(cs.CHANNEL_TYPE_TEXT, rcc[0].get(cs.CHANNEL_TYPE)) -- 1.8.4.rc3