[telepathy-salut/master] sync with latest tube spec DRAFT

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Wed Apr 29 06:26:19 PDT 2009


{Offer,Accept}StreamTube methods and the StreamTubeNewConnection
signal have been renamed.
---
 extensions/Channel_Interface_Tube.xml              |   16 +++---
 extensions/Channel_Type_DBus_Tube.xml              |    8 ++--
 extensions/Channel_Type_Stream_Tube.xml            |   16 +++---
 src/tube-stream.c                                  |   46 ++++++++++----------
 .../avahi/test-offer-private-stream-tube.py        |    2 +-
 tests/twisted/avahi/test-two-muc-stream-tubes.py   |    8 ++--
 .../twisted/avahi/test-two-private-stream-tubes.py |    8 ++--
 7 files changed, 52 insertions(+), 52 deletions(-)

diff --git a/extensions/Channel_Interface_Tube.xml b/extensions/Channel_Interface_Tube.xml
index 3e9a527..36addef 100644
--- a/extensions/Channel_Interface_Tube.xml
+++ b/extensions/Channel_Interface_Tube.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" ?>
 <node name="/Channel_Interface_Tube" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
-  <tp:copyright>Copyright (C) 2008 Collabora Limited</tp:copyright>
-  <tp:copyright>Copyright (C) 2008 Nokia Corporation</tp:copyright>
+  <tp:copyright>Copyright © 2008-2009 Collabora Limited</tp:copyright>
+  <tp:copyright>Copyright © 2008-2009 Nokia Corporation</tp:copyright>
   <tp:license>
     This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
@@ -26,9 +26,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
       systems to communicate without having to establish network
       connections themselves. Currently, two types of tube exist:
       <tp:dbus-ref namespace="org.freedesktop.Telepathy"
-      >Channel.Type.DBusTube</tp:dbus-ref> and
+      >Channel.Type.DBusTube.DRAFT</tp:dbus-ref> and
       <tp:dbus-ref namespace="org.freedesktop.Telepathy"
-      >Channel.Type.StreamTube</tp:dbus-ref>. This interface contains
+      >Channel.Type.StreamTube.DRAFT</tp:dbus-ref>. This interface contains
       the properties, signals and methods common to both types of tube;
       you can only create channels of a specific tube type, not of this
       type. A tube channel contains exactly one tube; if you need several
@@ -42,8 +42,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
       <p>As an exception to the usual handling of capabilities, connection managers
         for protocols with capability discovery, such as XMPP, SHOULD advertise the
         capability representing each Tube type that they support
-       (<tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel.Type.DBusTube</tp:dbus-ref> and/or
-        <tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel.Type.StreamTube</tp:dbus-ref>)
+       (<tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel.Type.DBusTube.DRAFT</tp:dbus-ref> and/or
+        <tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel.Type.StreamTube.DRAFT</tp:dbus-ref>)
         even if no client has indicated via
         <tp:dbus-ref
           namespace="org.freedesktop.Telepathy.Connection.Interface.ContactCapabilities.DRAFT">SetSelfCapabilities</tp:dbus-ref>
@@ -80,8 +80,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
         <p>When requesting a channel with
           <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Requests.CreateChannel</tp:dbus-ref>,
           this property MUST NOT be included in the request. This property is undefined until the tube is offered
-          (using <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Type.StreamTube.DRAFT">OfferStreamTube</tp:dbus-ref>
-          or <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Type.DBusTube.DRAFT">OfferDBusTube</tp:dbus-ref>).
+          (using <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Type.StreamTube.DRAFT">Offer</tp:dbus-ref>
+          or <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Type.DBusTube.DRAFT">Offer</tp:dbus-ref>).
           Once it has been offered, this property MUST NOT change.</p>
         <p>When receiving an incoming tube, this property is immutable and so advertised in the
           <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Requests.NewChannels</tp:dbus-ref>
diff --git a/extensions/Channel_Type_DBus_Tube.xml b/extensions/Channel_Type_DBus_Tube.xml
index 06a899d..fe2c949 100644
--- a/extensions/Channel_Type_DBus_Tube.xml
+++ b/extensions/Channel_Type_DBus_Tube.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" ?>
 <node name="/Channel_Type_DBus_Tube" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
-  <tp:copyright>Copyright (C) 2008 Collabora Limited</tp:copyright>
-  <tp:copyright>Copyright (C) 2008 Nokia Corporation</tp:copyright>
+  <tp:copyright>Copyright © 2008-2009 Collabora Limited</tp:copyright>
+  <tp:copyright>Copyright © 2008-2009 Nokia Corporation</tp:copyright>
   <tp:license>
     This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
@@ -54,7 +54,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
     </tp:docstring>
 
-    <method name="OfferDBusTube" tp:name-for-bindings="Offer_DBus_Tube">
+    <method name="Offer" tp:name-for-bindings="Offer">
       <tp:docstring>
         Offers a D-Bus tube providing the service specified.
       </tp:docstring>
@@ -83,7 +83,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
       </tp:possible-errors>
     </method>
 
-    <method name="AcceptDBusTube" tp:name-for-bindings="Accept_DBus_Tube">
+    <method name="Accept" tp:name-for-bindings="Accept">
       <tp:docstring>
         Accept a D-Bus tube that's in the "local pending" state. The
         connection manager will attempt to open the tube. The tube remains in
diff --git a/extensions/Channel_Type_Stream_Tube.xml b/extensions/Channel_Type_Stream_Tube.xml
index 1c721d0..a655ece 100644
--- a/extensions/Channel_Type_Stream_Tube.xml
+++ b/extensions/Channel_Type_Stream_Tube.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" ?>
 <node name="/Channel_Type_Stream_Tube" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
-  <tp:copyright>Copyright (C) 2008 Collabora Limited</tp:copyright>
-  <tp:copyright>Copyright (C) 2008 Nokia Corporation</tp:copyright>
+  <tp:copyright>Copyright © 2008-2009 Collabora Limited</tp:copyright>
+  <tp:copyright>Copyright © 2008-2009 Nokia Corporation</tp:copyright>
   <tp:license>
     This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
@@ -27,9 +27,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
       <p>When offering a stream tube, the initiating client creates a local
         listening socket and offers it to the recipient client using the
-        <tp:member-ref>OfferStreamTube</tp:member-ref> method.  When a
+        <tp:member-ref>Offer</tp:member-ref> method.  When a
         recipient accepts a stream tube using the
-        <tp:member-ref>AcceptStreamTube</tp:member-ref> method, the
+        <tp:member-ref>Accept</tp:member-ref> method, the
         recipient's connection manager creates a new local listening socket.
         Each time the recipient's client connects to this socket, the
         initiator's connection manager proxies this connection to the
@@ -37,7 +37,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
     </tp:docstring>
 
-    <method name="OfferStreamTube" tp:name-for-bindings="Offer_Stream_Tube">
+    <method name="Offer" tp:name-for-bindings="Offer">
       <tp:docstring>
         Offer a stream tube exporting the local socket specified.
       </tp:docstring>
@@ -91,7 +91,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
       </tp:possible-errors>
     </method>
 
-    <method name="AcceptStreamTube" tp:name-for-bindings="Accept_Stream_Tube">
+    <method name="Accept" tp:name-for-bindings="Accept">
       <tp:docstring>
         Accept a stream tube that's in the "local pending" state. The
         connection manager will attempt to open the tube. The tube remains in
@@ -137,8 +137,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
       </tp:possible-errors>
     </method>
 
-    <signal name="StreamTubeNewConnection"
-            tp:name-for-bindings="Stream_Tube_New_Connection">
+    <signal name="NewConnection"
+            tp:name-for-bindings="New_Connection">
       <tp:docstring>
         Emitted on a stream tube when a participant opens a new connection
         to its socket.
diff --git a/src/tube-stream.c b/src/tube-stream.c
index c64f0bf..61d7aba 100644
--- a/src/tube-stream.c
+++ b/src/tube-stream.c
@@ -2052,7 +2052,7 @@ salut_tube_stream_add_bytestream (SalutTubeIface *tube,
 
       g_signal_emit (G_OBJECT (self), signals[NEW_CONNECTION], 0, contact);
 
-      salut_svc_channel_type_stream_tube_emit_stream_tube_new_connection (
+      salut_svc_channel_type_stream_tube_emit_new_connection (
           self, contact);
 
       tp_handle_unref (contact_repo, contact);
@@ -2242,19 +2242,19 @@ salut_tube_stream_check_params (TpSocketAddressType address_type,
 }
 
 /**
- * salut_tube_stream_offer_stream_tube
+ * salut_tube_stream_offer_async
  *
- * Implements D-Bus method OfferStreamTube
+ * Implements D-Bus method Offer
  * on org.freedesktop.Telepathy.Channel.Type.StreamTube
  */
 static void
-salut_tube_stream_offer_stream_tube (SalutSvcChannelTypeStreamTube *iface,
-                                     guint address_type,
-                                     const GValue *address,
-                                     guint access_control,
-                                     const GValue *access_control_param,
-                                     GHashTable *parameters,
-                                     DBusGMethodInvocation *context)
+salut_tube_stream_offer_async (SalutSvcChannelTypeStreamTube *iface,
+    guint address_type,
+    const GValue *address,
+    guint access_control,
+    const GValue *access_control_param,
+    GHashTable *parameters,
+    DBusGMethodInvocation *context)
 {
   SalutTubeStream *self = SALUT_TUBE_STREAM (iface);
   SalutTubeStreamPrivate *priv = SALUT_TUBE_STREAM_GET_PRIVATE (self);
@@ -2297,21 +2297,21 @@ salut_tube_stream_offer_stream_tube (SalutSvcChannelTypeStreamTube *iface,
       return;
     }
 
-  salut_svc_channel_type_stream_tube_return_from_offer_stream_tube (context);
+  salut_svc_channel_type_stream_tube_return_from_offer (context);
 }
 
 /**
- * salut_tube_stream_accept_stream_tube
+ * salut_tube_stream_accept_async
  *
- * Implements D-Bus method AcceptStreamTube
+ * Implements D-Bus method Accept
  * on org.freedesktop.Telepathy.Channel.Type.StreamTube
  */
 static void
-salut_tube_stream_accept_stream_tube (SalutSvcChannelTypeStreamTube *iface,
-                                      guint address_type,
-                                      guint access_control,
-                                      const GValue *access_control_param,
-                                      DBusGMethodInvocation *context)
+salut_tube_stream_accept_async (SalutSvcChannelTypeStreamTube *iface,
+    guint address_type,
+    guint access_control,
+    const GValue *access_control_param,
+    DBusGMethodInvocation *context)
 {
   SalutTubeStream *self = SALUT_TUBE_STREAM (iface);
   SalutTubeStreamPrivate *priv = SALUT_TUBE_STREAM_GET_PRIVATE (self);
@@ -2366,7 +2366,7 @@ salut_tube_stream_accept_stream_tube (SalutSvcChannelTypeStreamTube *iface,
     salut_muc_channel_send_presence (self->muc, NULL);
 #endif
 
-  salut_svc_channel_type_stream_tube_return_from_accept_stream_tube (context,
+  salut_svc_channel_type_stream_tube_return_from_accept (context,
       priv->address);
 }
 
@@ -2541,10 +2541,10 @@ streamtube_iface_init (gpointer g_iface,
   SalutSvcChannelTypeStreamTubeClass *klass =
       (SalutSvcChannelTypeStreamTubeClass *) g_iface;
 
-#define IMPLEMENT(x) salut_svc_channel_type_stream_tube_implement_##x (\
-    klass, salut_tube_stream_##x)
-  IMPLEMENT(offer_stream_tube);
-  IMPLEMENT(accept_stream_tube);
+#define IMPLEMENT(x, suffix) salut_svc_channel_type_stream_tube_implement_##x (\
+    klass, salut_tube_stream_##x##suffix)
+  IMPLEMENT(offer,_async);
+  IMPLEMENT(accept,_async);
 #undef IMPLEMENT
 }
 
diff --git a/tests/twisted/avahi/test-offer-private-stream-tube.py b/tests/twisted/avahi/test-offer-private-stream-tube.py
index fd531b6..d1787b0 100644
--- a/tests/twisted/avahi/test-offer-private-stream-tube.py
+++ b/tests/twisted/avahi/test-offer-private-stream-tube.py
@@ -311,7 +311,7 @@ def test(q, bus, conn):
     check_channel_properties(q, bus, conn, tube_channel, "StreamTube.DRAFT",
             handle, contact_name, 3)
 
-    tube_channel.OfferStreamTube(SOCKET_ADDRESS_TYPE_UNIX, dbus.ByteArray(server_socket_address),
+    tube_channel.Offer(SOCKET_ADDRESS_TYPE_UNIX, dbus.ByteArray(server_socket_address),
             SOCKET_ACCESS_CONTROL_LOCALHOST, "", {'foo': 'bar'})
 
     e = q.expect('stream-iq')
diff --git a/tests/twisted/avahi/test-two-muc-stream-tubes.py b/tests/twisted/avahi/test-two-muc-stream-tubes.py
index 1e67e06..0a1f54a 100644
--- a/tests/twisted/avahi/test-two-muc-stream-tubes.py
+++ b/tests/twisted/avahi/test-two-muc-stream-tubes.py
@@ -352,14 +352,14 @@ def test(q, bus, conn):
     q.expect('dbus-signal', signal='MembersChanged', path=txt_path,
         args=['', [conn1_self_handle], [], [], [], conn1_self_handle, 0])
 
-    call_async(q, contact1_stream_tube, 'OfferStreamTube',
+    call_async(q, contact1_stream_tube, 'Offer',
             SOCKET_ADDRESS_TYPE_UNIX, dbus.ByteArray(server_socket_address),
             SOCKET_ACCESS_CONTROL_LOCALHOST, "", sample_parameters)
 
     q.expect_many(
         EventPattern('dbus-signal', signal='TubeChannelStateChanged',
             args=[TUBE_CHANNEL_STATE_OPEN]),
-        EventPattern('dbus-return', method='OfferStreamTube'))
+        EventPattern('dbus-return', method='Offer'))
 
     state = contact1_stream_tube.Get(CHANNEL_IFACE_TUBE, 'State',
         dbus_interface=PROPERTIES_IFACE)
@@ -436,7 +436,7 @@ def test(q, bus, conn):
     assert state == TUBE_CHANNEL_STATE_LOCAL_PENDING
 
     # second connection: accept the tube (new API)
-    unix_socket_adr = contact2_stream_tube.AcceptStreamTube(
+    unix_socket_adr = contact2_stream_tube.Accept(
         SOCKET_ADDRESS_TYPE_UNIX, SOCKET_ACCESS_CONTROL_LOCALHOST, '',
         byte_arrays=True)
 
@@ -458,7 +458,7 @@ def test(q, bus, conn):
     client_transport = e.transport
 
     sig, e = q.expect_many(
-        EventPattern('dbus-signal', signal='StreamTubeNewConnection',
+        EventPattern('dbus-signal', signal='NewConnection',
             path=tube1_path),
         EventPattern('client-data-received'))
 
diff --git a/tests/twisted/avahi/test-two-private-stream-tubes.py b/tests/twisted/avahi/test-two-private-stream-tubes.py
index 322cbac..fd1b60a 100644
--- a/tests/twisted/avahi/test-two-private-stream-tubes.py
+++ b/tests/twisted/avahi/test-two-private-stream-tubes.py
@@ -260,13 +260,13 @@ def test(q, bus, conn):
     state = contact1_stream_tube.Get(CHANNEL_IFACE_TUBE, 'State', dbus_interface=PROPERTIES_IFACE)
     assert state == TUBE_CHANNEL_STATE_NOT_OFFERED
 
-    call_async(q, contact1_stream_tube, 'OfferStreamTube', SOCKET_ADDRESS_TYPE_UNIX,
+    call_async(q, contact1_stream_tube, 'Offer', SOCKET_ADDRESS_TYPE_UNIX,
             dbus.ByteArray(server_socket_address), SOCKET_ACCESS_CONTROL_LOCALHOST, "", sample_parameters)
 
     _, return_event, new_chans = q.expect_many(
         EventPattern('dbus-signal', signal='TubeChannelStateChanged',
             args=[TUBE_CHANNEL_STATE_REMOTE_PENDING]),
-        EventPattern('dbus-return', method='OfferStreamTube'),
+        EventPattern('dbus-return', method='Offer'),
         EventPattern('dbus-signal', signal='NewChannels', path=conn2.object.object_path))
 
     state = contact1_stream_tube.Get(CHANNEL_IFACE_TUBE, 'State', dbus_interface=PROPERTIES_IFACE)
@@ -312,7 +312,7 @@ def test(q, bus, conn):
     assert state == TUBE_CHANNEL_STATE_LOCAL_PENDING
 
     # second connection: accept the tube (new API)
-    unix_socket_adr = contact2_stream_tube.AcceptStreamTube(SOCKET_ADDRESS_TYPE_UNIX,
+    unix_socket_adr = contact2_stream_tube.Accept(SOCKET_ADDRESS_TYPE_UNIX,
         SOCKET_ACCESS_CONTROL_LOCALHOST, '', byte_arrays=True)
 
     state = contact2_tube.Get(CHANNEL_IFACE_TUBE, 'State', dbus_interface=PROPERTIES_IFACE)
@@ -335,7 +335,7 @@ def test(q, bus, conn):
     client_transport = e.transport
 
     sig, e = q.expect_many(
-        EventPattern('dbus-signal', signal='StreamTubeNewConnection', path=tube1_path),
+        EventPattern('dbus-signal', signal='NewConnection', path=tube1_path),
         EventPattern('client-data-received'))
 
     handle = sig.args[0]
-- 
1.5.6.5




More information about the telepathy-commits mailing list