From 8fe3336d9c0420e2b561b0a21c6c1f0218ef1120 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 26 Oct 2011 15:50:31 +0200 Subject: [PATCH] Advertise ContactBlocking if supported https://bugs.freedesktop.org/show_bug.cgi?id=42281 --- src/connection.c | 8 ++++++++ tests/twisted/constants.py | 1 + tests/twisted/roster/test-google-roster.py | 4 ++++ 3 files changed, 13 insertions(+), 0 deletions(-) diff --git a/src/connection.c b/src/connection.c index 1ea7d65..9ff46ee 100644 --- a/src/connection.c +++ b/src/connection.c @@ -2815,6 +2815,14 @@ set_status_to_connected (GabbleConnection *conn) tp_base_connection_add_interfaces ((TpBaseConnection *) conn, ifaces); } + if (tp_base_contact_list_can_block (gabble_connection_get_contact_list (conn))) + { + const gchar *ifaces[] = + { TP_IFACE_CONNECTION_INTERFACE_CONTACT_BLOCKING, NULL }; + + tp_base_connection_add_interfaces ((TpBaseConnection *) conn, ifaces); + } + /* go go gadget on-line */ tp_base_connection_change_status (base, TP_CONNECTION_STATUS_CONNECTED, TP_CONNECTION_STATUS_REASON_REQUESTED); diff --git a/tests/twisted/constants.py b/tests/twisted/constants.py index e9381cd..bbb10ca 100644 --- a/tests/twisted/constants.py +++ b/tests/twisted/constants.py @@ -137,6 +137,7 @@ CONN_IFACE_CONTACT_LIST = CONN + '.Interface.ContactList' CONN_IFACE_CONTACT_GROUPS = CONN + '.Interface.ContactGroups' CONN_IFACE_CLIENT_TYPES = CONN + '.Interface.ClientTypes' CONN_IFACE_POWER_SAVING = CONN + '.Interface.PowerSaving' +CONN_IFACE_CONTACT_BLOCKING = CONN + '.Interface.ContactBlocking' ATTR_CONTACT_CAPABILITIES = CONN_IFACE_CONTACT_CAPS + '/capabilities' diff --git a/tests/twisted/roster/test-google-roster.py b/tests/twisted/roster/test-google-roster.py index 630e3c3..0886cf9 100644 --- a/tests/twisted/roster/test-google-roster.py +++ b/tests/twisted/roster/test-google-roster.py @@ -295,6 +295,10 @@ def test_deny_simple(q, bus, conn, stream, stored, deny): EventPattern('dbus-return', method='RemoveMembers'), ) + assertContains(cs.CONN_IFACE_CONTACT_BLOCKING, + conn.Get(cs.CONN, "Interfaces", + dbus_interface=cs.PROPERTIES_IFACE)) + # Our server sends roster pushes in response to our unsubscribe and # unsubscribed commands. stream.send(make_set_roster_iq(stream, 'test@localhost/Resource', contact, -- 1.7.4.1