diff options
| author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-02-07 14:15:29 +0000 | 
|---|---|---|
| committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-02-07 14:32:43 +0000 | 
| commit | 1df43ccd016fc8b35d40d1717440f3a89bff491d (patch) | |
| tree | c030637becb0960142c1aebcda97ed30472ecf3c | |
| parent | 1d48728c6cebf4a4cea29f580f25220510f417bf (diff) | |
| parent | 33430f006934add269f6858dc7b9af6eadbc30ca (diff) | |
Merge branch 'master' into next
Because the test interface is the last thing in the extensions static
library, we have to add it to symbol-hacks.c so that it's visible to
the plugin. This wouldn't work on platforms where plugins can't have
undefined symbols, like Windows - we'd need something more like
Mission Control's mission-control-plugins or Gabble's libgabble-plugins
there - but it'll do for now.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=70382
Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
| -rw-r--r-- | extensions/Connection_Future.xml | 110 | ||||
| -rw-r--r-- | extensions/Makefile.am | 1 | ||||
| -rw-r--r-- | extensions/all.xml | 1 | ||||
| -rw-r--r-- | src/connection.c | 20 | ||||
| -rw-r--r-- | src/symbol-hacks.c | 7 | ||||
| -rw-r--r-- | tests/twisted/constants.py | 8 | ||||
| -rw-r--r-- | tests/twisted/servicetest.py | 1 | ||||
| -rw-r--r-- | tests/twisted/sidecars.py | 10 | 
8 files changed, 21 insertions, 137 deletions
| diff --git a/extensions/Connection_Future.xml b/extensions/Connection_Future.xml deleted file mode 100644 index ad08642e..00000000 --- a/extensions/Connection_Future.xml +++ /dev/null @@ -1,110 +0,0 @@ -<?xml version="1.0" ?> -<node name="/Connection_FUTURE" -  xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" -  > -  <tp:copyright>Copyright © 2009 Collabora Limited</tp:copyright> -  <tp:copyright>Copyright © 2009 Nokia Corporation</tp:copyright> -  <tp:license xmlns="http://www.w3.org/1999/xhtml"> -<p>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.</p> - -<p>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.</p> - -<p>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 Street, Fifth Floor, Boston, MA 02110-1301, -USA.</p> -  </tp:license> -  <interface name="im.telepathy.v1.Connection.FUTURE" -             tp:causes-havoc='experimental'> -    <tp:requires interface="im.telepathy.v1.Connection"/> - -    <method name="EnsureSidecar" tp:name-for-bindings="Ensure_Sidecar"> -      <tp:added version="0.19.UNRELEASED"/> - -      <arg direction="in" name="Main_Interface" type="s" -           tp:type="DBus_Interface"> -        <tp:docstring> -          The "primary" interface implemented by an object attached -          to a connection. For example, a Gabble plugin implementing -          fine-grained control of XEP-0016 privacy lists might expose an object -          implementing <tt>com.example.PrivacyLists</tt>. -        </tp:docstring> -      </arg> - -      <arg direction="out" name="Path" type="o"> -        <tp:docstring>The object path of the sidecar, exported by the same bus -          name as the Connection to which it is attached.</tp:docstring> -      </arg> -      <arg direction="out" name="Properties" type="a{sv}" -           tp:type="Qualified_Property_Value_Map"> -        <tp:docstring>Immutable properties of the sidecar.</tp:docstring> -      </arg> - -      <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> -        <p>Request an object with a particular interface providing additional -          connection-specific functionality, together with its immutable -          properties. These will often be implemented by plug-ins to the -          connection managers; for example, support for an XMPP XEP for which -          no generic Telepathy interface exists might be implemented by a -          Gabble plugin exposing a sidecar with a particular interface.</p> - -        <p>This method may be called at any point during the lifetime of a -          connection, even before its <tp:type>Connection_Status</tp:type> -          changes to Connected. It MAY take a long time to -          return—perhaps it needs to wait for a connection to be established -          and for all the services supported by the server to be discovered -          before determining whether necessary server-side support is -          available—so callers SHOULD override the default method timeout (25 -          seconds) with a much higher value (perhaps even MAX_INT32, meaning -          “no timeout” in recent versions of libdbus).</p> - -        <tp:rationale> -          <p>There is an implicit assumption that any connection -            manager plugin will only want to export one “primary” object per -            feature it implements, since there is a one-to-one mapping between -            interface and object. This is reasonable since Sidecars are -            (intended to be) analogous to extra interfaces on the connection, -            providing once-per-connection shared functionality; it also makes -            client code straightforward (look up the interface you care about -            in a dictionary, build a proxy object from the value). More -            “plural” plugins are likely to want to implement new types of -            <tp:dbus-ref -              namespace="im.telepathy.v1">Channel</tp:dbus-ref> -            instead.</p> -        </tp:rationale> -      </tp:docstring> - -      <tp:error name="im.telepathy.v1.Error.NotImplemented"> -        <tp:docstring> -          The requested sidecar is not implemented by this connection manager, -          or a necessary server-side component does not exist. (FIXME: split -          these two errors out? Then again, once we list the guaranteed and -          possible sidecars on a Protocol object, clients can tell the -          difference themselves, because they shouldn't be calling this in the -          first case.) -        </tp:docstring> -      </tp:error> - -      <tp:error name="im.telepathy.v1.Error.ServiceBusy"> -        <tp:docstring> -          A server-side component needed by the requested sidecar reported it -          is currently too busy, or did not respond for some -          implementation-defined time. The caller may wish to try again later. -        </tp:docstring> -      </tp:error> - -      <tp:error name="im.telepathy.v1.Error.Cancelled"> -        <tp:docstring> -          The connection was disconnected while the sidecar was being set up. -        </tp:docstring> -      </tp:error> -    </method> - -  </interface> -</node> diff --git a/extensions/Makefile.am b/extensions/Makefile.am index 5edd07d0..380c9912 100644 --- a/extensions/Makefile.am +++ b/extensions/Makefile.am @@ -3,7 +3,6 @@ tools_dir = $(top_srcdir)/tools  EXTRA_DIST = \      connection.xml \      Salut_Plugin_Test.xml \ -    Connection_Future.xml \      all.xml  noinst_LTLIBRARIES = libsalut-extensions.la diff --git a/extensions/all.xml b/extensions/all.xml index befed66d..65951e14 100644 --- a/extensions/all.xml +++ b/extensions/all.xml @@ -24,7 +24,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</p>  <xi:include href="connection.xml"/>  <xi:include href="Salut_Plugin_Test.xml"/> -<xi:include href="Connection_Future.xml"/>  <tp:generic-types>    <tp:external-type name="Contact_Handle" type="u" diff --git a/src/connection.c b/src/connection.c index 6f7957aa..6aea5323 100644 --- a/src/connection.c +++ b/src/connection.c @@ -81,7 +81,7 @@ static void  salut_plugin_connection_iface_init (SalutPluginConnectionInterface *iface,      gpointer iface_data); -static void salut_conn_future_iface_init (gpointer, gpointer); +static void salut_conn_sidecars_iface_init (gpointer, gpointer);  #define DISCONNECT_TIMEOUT 5 @@ -103,8 +103,8 @@ G_DEFINE_TYPE_WITH_CODE(SalutConnection,        salut_conn_contact_caps_iface_init);      G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_INFO1,          salut_conn_contact_info_iface_init); -    G_IMPLEMENT_INTERFACE (SALUT_TYPE_SVC_CONNECTION_FUTURE, -      salut_conn_future_iface_init); +    G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_SIDECARS1, +      salut_conn_sidecars_iface_init);      G_IMPLEMENT_INTERFACE (SALUT_TYPE_PLUGIN_CONNECTION,        salut_plugin_connection_iface_init);      ) @@ -637,7 +637,7 @@ static const gchar *interfaces [] = {    TP_IFACE_CONNECTION_INTERFACE_CONTACT_CAPABILITIES1,    TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO1,    TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST1, -  SALUT_IFACE_CONNECTION_FUTURE, +  TP_IFACE_CONNECTION_INTERFACE_SIDECARS1,    NULL };  static GPtrArray * @@ -2325,7 +2325,7 @@ create_sidecar_cb (        GList *l;        for (l = contexts; l != NULL; l = l->next) -        salut_svc_connection_future_return_from_ensure_sidecar (l->data, +        tp_svc_connection_interface_sidecars1_return_from_ensure_sidecar (l->data,              path, props);        g_hash_table_unref (props); @@ -2347,7 +2347,7 @@ out:  static void  salut_connection_ensure_sidecar ( -    SalutSvcConnectionFUTURE *iface, +    TpSvcConnectionInterfaceSidecars1 *iface,      const gchar *sidecar_iface,      DBusGMethodInvocation *context)  { @@ -2386,7 +2386,7 @@ salut_connection_ensure_sidecar (        GHashTable *props = salut_sidecar_get_immutable_properties (sidecar);        DEBUG ("sidecar %s already exists at %s", sidecar_iface, path); -      salut_svc_connection_future_return_from_ensure_sidecar (context, path, +      tp_svc_connection_interface_sidecars1_return_from_ensure_sidecar (context, path,            props);        g_free (path); @@ -2490,13 +2490,13 @@ sidecars_conn_status_changed_cb (  }  static void -salut_conn_future_iface_init (gpointer g_iface, +salut_conn_sidecars_iface_init (gpointer g_iface,      gpointer iface_data)  { -  SalutSvcConnectionFUTUREClass *klass = g_iface; +  TpSvcConnectionInterfaceSidecars1Class *klass = g_iface;  #define IMPLEMENT(x) \ -    salut_svc_connection_future_implement_##x (\ +    tp_svc_connection_interface_sidecars1_implement_##x (\      klass, salut_connection_##x)    IMPLEMENT(ensure_sidecar);  #undef IMPLEMENT diff --git a/src/symbol-hacks.c b/src/symbol-hacks.c index 4f0b089b..28744cac 100644 --- a/src/symbol-hacks.c +++ b/src/symbol-hacks.c @@ -1,11 +1,11 @@  /* This is pretty horrible. If we don't use a symbol in a wocky object   * from its static library then libtool will not include said object   * from the binary, so we can't use any symbols from that object in a - * plugin. + * plugin. The extensions/ static library has the same problem.   *   * This is a hack that X does. They can generate their file though as   * they have an _X_EXPORT macro. This'll all disappear when Wocky - * becomes a shared library... + * becomes a shared library... except for the extensions/ bit.   *   * http://cgit.freedesktop.org/xorg/xserver/tree/hw/xfree86/loader/sdksyms.sh   */ @@ -16,6 +16,8 @@  /* First include all the public headers. */  #include <wocky/wocky.h> +#include <extensions/extensions.h> +  /* Reference one symbol from each of the above headers to include each   * object in the final binary. */  static void *hacks[] = { @@ -62,6 +64,7 @@ static void *hacks[] = {    wocky_xmpp_error_quark,    wocky_xmpp_reader_get_type,    wocky_xmpp_writer_get_type, +  salut_svc_salut_plugin_test_get_type,    NULL,  }; diff --git a/tests/twisted/constants.py b/tests/twisted/constants.py index a624ab08..f68e84d9 100644 --- a/tests/twisted/constants.py +++ b/tests/twisted/constants.py @@ -38,7 +38,6 @@ CHANNEL = PREFIX + ".Channel"  CHANNEL_IFACE_CHAT_STATE = CHANNEL + '.Interface.ChatState1'  CHANNEL_IFACE_DESTROYABLE = CHANNEL + ".Interface.Destroyable1" -CHANNEL_IFACE_DTMF = CHANNEL + ".Interface.DTMF1"  CHANNEL_IFACE_GROUP = CHANNEL + ".Interface.Group1"  CHANNEL_IFACE_HOLD = CHANNEL + ".Interface.Hold1"  CHANNEL_IFACE_PASSWORD = CHANNEL + ".Interface.Password1" @@ -51,7 +50,6 @@ CHANNEL_IFACE_SUBJECT = CHANNEL + '.Interface.Subject1'  CHANNEL_IFACE_FILE_TRANSFER_METADATA = CHANNEL + '.Interface.FileTransfer.Metadata1'  CHANNEL_TYPE_CALL = CHANNEL + ".Type.Call1" -CHANNEL_TYPE_CONTACT_LIST = CHANNEL + ".Type.ContactList1"  CHANNEL_TYPE_CONTACT_SEARCH = CHANNEL + ".Type.ContactSearch1"  CHANNEL_TYPE_TEXT = CHANNEL + ".Type.Text"  CHANNEL_TYPE_STREAM_TUBE = CHANNEL + ".Type.StreamTube1" @@ -86,6 +84,7 @@ CALL_INITIAL_AUDIO_NAME = CHANNEL_TYPE_CALL + '.InitialAudioName'  CALL_INITIAL_VIDEO = CHANNEL_TYPE_CALL + '.InitialVideo'  CALL_INITIAL_VIDEO_NAME = CHANNEL_TYPE_CALL + '.InitialVideoName'  CALL_MUTABLE_CONTENTS = CHANNEL_TYPE_CALL + '.MutableContents' +CALL_INITIAL_TONES = CHANNEL_TYPE_CALL + '.InitialTones'  CALL_CONTENT = PREFIX + '.Call1.Content'  CALL_CONTENT_IFACE_MEDIA = CALL_CONTENT + '.Interface.Media' @@ -193,7 +192,6 @@ CONN_IFACE_RENAMING = CONN + '.Interface.Renaming1'  CONN_IFACE_SIDECARS1 = CONN + '.Interface.Sidecars1'  CONN_IFACE_REQUESTS = CONN + '.Interface.Requests'  CONN_IFACE_LOCATION = CONN + '.Interface.Location1' -CONN_IFACE_GABBLE_DECLOAK = CONN + '.Interface.Gabble.Decloak'  CONN_IFACE_MAIL_NOTIFICATION = CONN + '.Interface.MailNotification1'  CONN_IFACE_CONTACT_LIST = CONN + '.Interface.ContactList1'  CONN_IFACE_CONTACT_GROUPS = CONN + '.Interface.ContactGroups1' @@ -208,7 +206,6 @@ ATTR_AVATAR_TOKEN = CONN_IFACE_AVATARS + '/token'  ATTR_CLIENT_TYPES = CONN_IFACE_CLIENT_TYPES + '/client-types'  ATTR_CONTACT_CAPABILITIES = CONN_IFACE_CONTACT_CAPS + '/capabilities'  ATTR_CONTACT_ID = CONN + '/contact-id' -ATTR_CONTACT_ID = CONN + '/contact-id'  ATTR_CONTACT_INFO = CONN_IFACE_CONTACT_INFO + '/info'  ATTR_GROUPS = CONN_IFACE_CONTACT_GROUPS + '/groups'  ATTR_LOCATION = CONN_IFACE_LOCATION + '/location' @@ -578,9 +575,6 @@ CD_PATH = PATH_PREFIX + '/ChannelDispatcher'  MC = PREFIX + '.MissionControl6'  MC_PATH = PATH_PREFIX + '/MissionControl6' -DTMF_CURRENTLY_SENDING_TONES = CHANNEL_IFACE_DTMF + '.CurrentlySendingTones' -DTMF_INITIAL_TONES = CHANNEL_IFACE_DTMF + '.InitialTones' -DTMF_DEFERRED_TONES = CHANNEL_IFACE_DTMF + '.DeferredTones'  TESTS = PREFIX + ".Tests"  TESTDOT = PREFIX + ".Test." diff --git a/tests/twisted/servicetest.py b/tests/twisted/servicetest.py index e9975698..86212f32 100644 --- a/tests/twisted/servicetest.py +++ b/tests/twisted/servicetest.py @@ -634,7 +634,6 @@ def wrap_connection(conn):           ('Location', cs.CONN_IFACE_LOCATION),           ('Presence', cs.CONN_IFACE_PRESENCE),           ('Requests', cs.CONN_IFACE_REQUESTS), -         ('Future', tp_name_prefix + '.Connection.FUTURE'),           ('MailNotification', cs.CONN_IFACE_MAIL_NOTIFICATION),           ('ContactList', cs.CONN_IFACE_CONTACT_LIST),           ('ContactGroups', cs.CONN_IFACE_CONTACT_GROUPS), diff --git a/tests/twisted/sidecars.py b/tests/twisted/sidecars.py index 87941f07..5b7ad76b 100644 --- a/tests/twisted/sidecars.py +++ b/tests/twisted/sidecars.py @@ -18,7 +18,7 @@ if not PLUGINS_ENABLED:  def test(q, bus, conn):      # Request a sidecar thate we support before we're connected; it should just      # wait around until we're connected. -    call_async(q, conn.Future, 'EnsureSidecar', TEST_PLUGIN_IFACE) +    call_async(q, conn.Sidecars1, 'EnsureSidecar', TEST_PLUGIN_IFACE)      conn.Connect() @@ -30,18 +30,18 @@ def test(q, bus, conn):          assertEquals({}, props)          # We should get the same sidecar if we request it again -        path2, props2 = conn.Future.EnsureSidecar(TEST_PLUGIN_IFACE) +        path2, props2 = conn.Sidecars1.EnsureSidecar(TEST_PLUGIN_IFACE)          assertEquals((path, props), (path2, props2))      else:          # Only now does it fail.          q.expect('dbus-error', method='EnsureSidecar')      # This is not a valid interface name -    call_async(q, conn.Future, 'EnsureSidecar', 'not an interface') +    call_async(q, conn.Sidecars1, 'EnsureSidecar', 'not an interface')      q.expect('dbus-error', name=cs.INVALID_ARGUMENT)      # The test plugin makes no reference to this interface. -    call_async(q, conn.Future, 'EnsureSidecar', 'unsupported.sidecar') +    call_async(q, conn.Sidecars1, 'EnsureSidecar', 'unsupported.sidecar')      q.expect('dbus-error', name=cs.NOT_IMPLEMENTED)      call_async(q, conn, 'Disconnect') @@ -51,7 +51,7 @@ def test(q, bus, conn):              args=[cs.CONN_STATUS_DISCONNECTED, cs.CSR_REQUESTED]),          ) -    call_async(q, conn.Future, 'EnsureSidecar', 'zomg.what') +    call_async(q, conn.Sidecars1, 'EnsureSidecar', 'zomg.what')      # With older telepathy-glib this would be DISCONNECTED;      # with newer telepathy-glib the Connection disappears from the bus      # sooner, and you get UnknownMethod or something from dbus-glib. | 
