[telepathy-mission-control/master] Implement final version of ContactCapabilities instead of draft 2
Simon McVittie
simon.mcvittie at collabora.co.uk
Fri Sep 11 09:40:58 PDT 2009
---
src/Makefile.am | 4 +-
src/mcd-connection.c | 30 +++++++++----------
src/mcd-dispatcher.c | 2 +-
src/mcd.xml | 2 +-
test/twisted/Makefile.am | 2 +-
.../capabilities/{draft-2.py => contact-caps.py} | 18 ++++++------
test/twisted/capabilities/legacy-caps.py | 4 --
test/twisted/constants.py | 2 +-
... Connection_Interface_Contact_Capabilities.xml} | 8 ++---
xml/nmc5.xml | 2 +-
10 files changed, 33 insertions(+), 41 deletions(-)
rename test/twisted/capabilities/{draft-2.py => contact-caps.py} (92%)
rename xml/{Connection_Interface_Contact_Capabilities_Draft2.xml => Connection_Interface_Contact_Capabilities.xml} (97%)
diff --git a/src/Makefile.am b/src/Makefile.am
index f3139ad..a990eaa 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -32,7 +32,7 @@ mc_headers = \
mc_gen_headers = \
_gen/cli-Connection_Interface_Contact_Capabilities_Draft1.h \
- _gen/cli-Connection_Interface_Contact_Capabilities_Draft2.h \
+ _gen/cli-Connection_Interface_Contact_Capabilities.h \
_gen/enums.h \
_gen/svc-Account_Interface_ChannelRequests.h \
_gen/svc-Account_Interface_Compat.h \
@@ -43,7 +43,7 @@ mc_gen_headers = \
nodist_libmcd_convenience_la_SOURCES = \
_gen/cli-Connection_Interface_Contact_Capabilities_Draft1-body.h \
- _gen/cli-Connection_Interface_Contact_Capabilities_Draft2-body.h \
+ _gen/cli-Connection_Interface_Contact_Capabilities-body.h \
_gen/register-dbus-glib-marshallers-body.h \
_gen/signals-marshal.c \
_gen/signals-marshal.h \
diff --git a/src/mcd-connection.c b/src/mcd-connection.c
index 052bbdc..1c7c151 100644
--- a/src/mcd-connection.c
+++ b/src/mcd-connection.c
@@ -71,9 +71,9 @@
#include "mcd-signals-marshal.h"
#include "_gen/cli-Connection_Interface_Contact_Capabilities_Draft1.h"
-#include "_gen/cli-Connection_Interface_Contact_Capabilities_Draft2.h"
+#include "_gen/cli-Connection_Interface_Contact_Capabilities.h"
#include "_gen/cli-Connection_Interface_Contact_Capabilities_Draft1-body.h"
-#include "_gen/cli-Connection_Interface_Contact_Capabilities_Draft2-body.h"
+#include "_gen/cli-Connection_Interface_Contact_Capabilities-body.h"
#define INITIAL_RECONNECTION_TIME 1 /* 1 second */
@@ -119,7 +119,7 @@ struct _McdConnectionPrivate
guint has_alias_if : 1;
guint has_capabilities_if : 1;
guint has_contact_capabilities_draft1_if : 1;
- guint has_contact_capabilities_draft2_if : 1;
+ guint has_contact_capabilities_if : 1;
guint has_requests_if : 1;
/* FALSE until the dispatcher has said it's ready for us */
@@ -585,9 +585,9 @@ _mcd_connection_setup_capabilities (McdConnection *connection)
GType type;
guint i;
- if (priv->has_contact_capabilities_draft2_if)
+ if (priv->has_contact_capabilities_if)
{
- DEBUG ("ContactCapabilities draft 2 in use, avoiding Capabilities");
+ DEBUG ("ContactCapabilities in use, avoiding Capabilities");
return;
}
@@ -1403,8 +1403,8 @@ on_connection_ready (TpConnection *tp_conn, const GError *error,
TP_IFACE_QUARK_CONNECTION_INTERFACE_CAPABILITIES);
priv->has_contact_capabilities_draft1_if = tp_proxy_has_interface_by_id (tp_conn,
MC_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_CAPABILITIES_DRAFT1);
- priv->has_contact_capabilities_draft2_if = tp_proxy_has_interface_by_id (tp_conn,
- MC_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_CAPABILITIES_DRAFT2);
+ priv->has_contact_capabilities_if = tp_proxy_has_interface_by_id (tp_conn,
+ MC_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_CAPABILITIES);
priv->has_requests_if = tp_proxy_has_interface_by_id (tp_conn,
TP_IFACE_QUARK_CONNECTION_INTERFACE_REQUESTS);
@@ -1456,14 +1456,14 @@ _mcd_connection_update_client_caps (McdConnection *self,
{
g_return_if_fail (MCD_IS_CONNECTION (self));
- if (!self->priv->has_contact_capabilities_draft2_if)
+ if (!self->priv->has_contact_capabilities_if)
{
- DEBUG ("ContactCapabilities.DRAFT2 unsupported");
+ DEBUG ("ContactCapabilities unsupported");
return;
}
DEBUG ("Sending client caps to connection");
- mc_cli_connection_interface_contact_capabilities_draft2_call_update_capabilities
+ mc_cli_connection_interface_contact_capabilities_call_update_capabilities
(self->priv->tp_conn, -1, client_caps, NULL, NULL, NULL, NULL);
}
@@ -1570,14 +1570,14 @@ mcd_connection_early_get_interfaces_cb (TpConnection *tp_conn,
mcd_connection_early_get_statuses_cb, NULL, NULL,
(GObject *) self);
}
- else if (q == MC_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_CAPABILITIES_DRAFT2)
+ else if (q == MC_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_CAPABILITIES)
{
GPtrArray *client_caps;
/* nail on the interface (TpConnection will eventually know
* how to do this for itself) */
tp_proxy_add_interface_by_id ((TpProxy *) tp_conn, q);
- self->priv->has_contact_capabilities_draft2_if = TRUE;
+ self->priv->has_contact_capabilities_if = TRUE;
/* we don't need to delay Connect for this, it can be
* fire-and-forget */
@@ -2022,10 +2022,8 @@ mcd_connection_add_signals (TpProxy *self,
quark,
proxy,
data);
- mc_cli_Connection_Interface_Contact_Capabilities_Draft2_add_signals (self,
- quark,
- proxy,
- data);
+ mc_cli_Connection_Interface_Contact_Capabilities_add_signals (self, quark,
+ proxy, data);
}
static void
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index 8f24790..74eebfb 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -2822,7 +2822,7 @@ name_owner_changed_cb (TpDBusDaemon *proxy,
if (!client->activatable)
{
- /* in ContactCapabilities.DRAFT2 we indicate the disappearance
+ /* in ContactCapabilities we indicate the disappearance
* of a client by giving it an empty set of capabilities and
* filters */
mcd_client_become_incapable (client);
diff --git a/src/mcd.xml b/src/mcd.xml
index d1dddbe..6e8e657 100644
--- a/src/mcd.xml
+++ b/src/mcd.xml
@@ -13,6 +13,6 @@
<xi:include href="../xml/Account_Manager_Interface_Creation.xml"/>
<xi:include href="../xml/Connection_Interface_Contact_Capabilities_Draft1.xml"/>
-<xi:include href="../xml/Connection_Interface_Contact_Capabilities_Draft2.xml"/>
+<xi:include href="../xml/Connection_Interface_Contact_Capabilities.xml"/>
</tp:spec>
diff --git a/test/twisted/Makefile.am b/test/twisted/Makefile.am
index 5ef15d1..19bf271 100644
--- a/test/twisted/Makefile.am
+++ b/test/twisted/Makefile.am
@@ -20,7 +20,7 @@ TWISTED_BASIC_TESTS = \
account-requests/create-text.py \
account-requests/delete-account-during-request.py \
capabilities/draft-1.py \
- capabilities/draft-2.py \
+ capabilities/contact-caps.py \
capabilities/legacy-caps.py \
dispatcher/approver-fails.py \
dispatcher/already-has-channel.py \
diff --git a/test/twisted/capabilities/draft-2.py b/test/twisted/capabilities/contact-caps.py
similarity index 92%
rename from test/twisted/capabilities/draft-2.py
rename to test/twisted/capabilities/contact-caps.py
index eac9c45..712028c 100644
--- a/test/twisted/capabilities/draft-2.py
+++ b/test/twisted/capabilities/contact-caps.py
@@ -19,7 +19,7 @@
import dbus
"""Regression test for pushing clients' capabilities into a CM with
-draft 2 of ContactCapabilities.
+ContactCapabilities (final version, which is the same as draft 2).
"""
import dbus
@@ -68,7 +68,7 @@ def test(q, bus, mc):
# wait for MC to download the properties
expect_client_setup(q, [media_call])
- def check_draft_2_caps(e):
+ def check_contact_caps(e):
structs = e.args[0]
filters = {}
@@ -106,19 +106,19 @@ def test(q, bus, mc):
"password": "secrecy"}, signature='sv')
cm_name_ref, account = create_fakecm_account(q, bus, mc, params)
conn, before, after = enable_fakecm_account(q, bus, mc, account, params,
- extra_interfaces=[cs.CONN_IFACE_CONTACT_CAPS_DRAFT2,
+ extra_interfaces=[cs.CONN_IFACE_CONTACT_CAPS,
cs.CONN_IFACE_CAPS],
expect_before_connect=[
EventPattern('dbus-method-call', handled=False,
- interface=cs.CONN_IFACE_CONTACT_CAPS_DRAFT2,
+ interface=cs.CONN_IFACE_CONTACT_CAPS,
method='UpdateCapabilities',
- predicate=check_draft_2_caps),
+ predicate=check_contact_caps),
],
expect_after_connect=[
EventPattern('dbus-method-call', handled=False,
- interface=cs.CONN_IFACE_CONTACT_CAPS_DRAFT2,
+ interface=cs.CONN_IFACE_CONTACT_CAPS,
method='UpdateCapabilities',
- predicate=check_draft_2_caps),
+ predicate=check_contact_caps),
])
q.dbus_return(before.message, signature='')
q.dbus_return(after.message, signature='')
@@ -139,7 +139,7 @@ def test(q, bus, mc):
expect_client_setup(q, [irssi])
e = q.expect('dbus-method-call', handled=False,
- interface=cs.CONN_IFACE_CONTACT_CAPS_DRAFT2,
+ interface=cs.CONN_IFACE_CONTACT_CAPS,
method='UpdateCapabilities')
assert len(e.args[0]) == 1
@@ -155,7 +155,7 @@ def test(q, bus, mc):
irssi_bus.close()
e = q.expect('dbus-method-call', handled=False,
- interface=cs.CONN_IFACE_CONTACT_CAPS_DRAFT2,
+ interface=cs.CONN_IFACE_CONTACT_CAPS,
method='UpdateCapabilities')
assert len(e.args[0]) == 1
diff --git a/test/twisted/capabilities/legacy-caps.py b/test/twisted/capabilities/legacy-caps.py
index aad9c80..81d99ab 100644
--- a/test/twisted/capabilities/legacy-caps.py
+++ b/test/twisted/capabilities/legacy-caps.py
@@ -20,10 +20,6 @@ import dbus
"""Regression test for pushing clients' capabilities into an old CM, with only
the old Capabilities interface.
-
-Until MC supports ContactCapabilities draft 2, this test will also apply to
-versions of Gabble that implement old Capabilities, and ContactCapabilities
-draft 1, but not draft 2.
"""
import dbus
diff --git a/test/twisted/constants.py b/test/twisted/constants.py
index f55ea7f..7013cf2 100644
--- a/test/twisted/constants.py
+++ b/test/twisted/constants.py
@@ -60,7 +60,7 @@ CONN_IFACE_AVATARS = CONN + '.Interface.Avatars'
CONN_IFACE_CAPS = CONN + '.Interface.Capabilities'
CONN_IFACE_CONTACTS = CONN + '.Interface.Contacts'
CONN_IFACE_CONTACT_CAPS_DRAFT1 = CONN + '.Interface.ContactCapabilities.DRAFT'
-CONN_IFACE_CONTACT_CAPS_DRAFT2 = CONN + '.Interface.ContactCapabilities.DRAFT2'
+CONN_IFACE_CONTACT_CAPS = CONN + '.Interface.ContactCapabilities'
CONN_IFACE_REQUESTS = CONN + '.Interface.Requests'
CONN_IFACE_SIMPLE_PRESENCE = CONN + '.Interface.SimplePresence'
diff --git a/xml/Connection_Interface_Contact_Capabilities_Draft2.xml b/xml/Connection_Interface_Contact_Capabilities.xml
similarity index 97%
rename from xml/Connection_Interface_Contact_Capabilities_Draft2.xml
rename to xml/Connection_Interface_Contact_Capabilities.xml
index e028e40..50f8b78 100644
--- a/xml/Connection_Interface_Contact_Capabilities_Draft2.xml
+++ b/xml/Connection_Interface_Contact_Capabilities.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
-<node name="/Connection_Interface_Contact_Capabilities_Draft2" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
+<node name="/Connection_Interface_Contact_Capabilities" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
<tp:copyright> Copyright (C) 2005, 2006, 2008 Collabora Limited </tp:copyright>
<tp:copyright> Copyright (C) 2005, 2006, 2008 Nokia Corporation </tp:copyright>
<tp:copyright> Copyright (C) 2006 INdT </tp:copyright>
@@ -18,11 +18,9 @@ Lesser General Public License for more details.</p>
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</p>
</tp:license>
- <interface name="org.freedesktop.Telepathy.Connection.Interface.ContactCapabilities.DRAFT2"
- tp:causes-havoc="experimental">
+ <interface name="org.freedesktop.Telepathy.Connection.Interface.ContactCapabilities">
<tp:requires interface="org.freedesktop.Telepathy.Connection"/>
- <tp:added version="0.17.16">(as a draft)</tp:added>
- <tp:changed version="0.17.27">(draft 2)</tp:changed>
+ <tp:added version="0.17.UNRELEASED">(as stable API)</tp:added>
<tp:docstring xmlns="http://www.w3.org/1999/xhtml">
<p>Contact capabilities describe the channel classes which may be
diff --git a/xml/nmc5.xml b/xml/nmc5.xml
index 4d1b47f..973081e 100644
--- a/xml/nmc5.xml
+++ b/xml/nmc5.xml
@@ -26,6 +26,6 @@
<xi:include href="Channel_Dispatch_Operation.xml"/>
<xi:include href="Connection_Interface_Contact_Capabilities_Draft1.xml"/>
-<xi:include href="Connection_Interface_Contact_Capabilities_Draft2.xml"/>
+<xi:include href="Connection_Interface_Contact_Capabilities.xml"/>
</tp:spec>
--
1.5.6.5
More information about the telepathy-commits
mailing list