diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-10-15 13:28:52 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-01-07 14:44:19 +0000 |
commit | 6bd36fff499df665cadd9427b85714266668a4af (patch) | |
tree | a5e92d08080949c6a19b1c094a20e4d519b55b16 | |
parent | bc4c02931fe37d7162a6741f0d660dc886f99367 (diff) | |
download | telepathy-idle-6bd36fff499df665cadd9427b85714266668a4af.tar.gz |
Use telepathy-glib 0.23 for Renaming interface
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=25147
Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
-rw-r--r-- | extensions/Connection_Interface_Renaming.xml | 98 | ||||
-rw-r--r-- | extensions/Makefile.am | 1 | ||||
-rw-r--r-- | extensions/all.xml | 1 | ||||
-rw-r--r-- | src/idle-connection.c | 20 |
4 files changed, 12 insertions, 108 deletions
diff --git a/extensions/Connection_Interface_Renaming.xml b/extensions/Connection_Interface_Renaming.xml deleted file mode 100644 index d08b748..0000000 --- a/extensions/Connection_Interface_Renaming.xml +++ /dev/null @@ -1,98 +0,0 @@ -<?xml version="1.0" ?> -<node name="/Connection_Interface_Renaming" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> - <tp:copyright> Copyright (C) 2005, 2006 Collabora Limited </tp:copyright> - <tp:copyright> Copyright (C) 2005, 2006 Nokia Corporation </tp:copyright> - <tp:copyright> Copyright (C) 2006 INdT </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="org.freedesktop.Telepathy.Connection.Interface.Renaming" - tp:causes-havoc='not well-tested'> - <tp:requires interface="org.freedesktop.Telepathy.Connection"/> - <signal name="Renamed" tp:name-for-bindings="Renamed"> - <arg name="Original" type="u" tp:type="Contact_Handle"> - <tp:docstring> - The handle of the original identifier - </tp:docstring> - </arg> - <arg name="New" type="u" tp:type="Contact_Handle"> - <tp:docstring> - The handle of the new identifier - </tp:docstring> - </arg> - <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> - <p>Emitted when the unique identifier of a contact on the server - changes.</p> - - <p>Any channels associated with the contact's original handle will - continue to be to that handle, and so are no longer useful (unless - the contact renames back, or another contact connects with that - unique ID). Clients may open a similar channel associated with the - new handle to continue communicating with the contact.</p> - - <p>For example, if a GUI client associates text - channels with chat windows, it should detach the old channel - from the chat window, closing it, and associate a channel to the - new handle with the same window.</p> - - <p>If the contact's old handle is in any of the member lists of - a channel which has the groups interface, it will be removed from - the channel and the new handle will be added. The resulting - <tp:dbus-ref - namespace="org.freedesktop.Telepathy.Channel.Interface.Group">MembersChanged</tp:dbus-ref> - signal must be emitted <em>after</em> the - <tp:member-ref>Renamed</tp:member-ref> signal; the reason should be - RENAMED. - </p> - - <p>The handles may be either general-purpose or channel-specific. - If the original handle is general-purpose, the new handle must be - general-purpose; if the original handle is channel-specific, the - new handle must be channel-specific in the same channel. - </p> - </tp:docstring> - </signal> - <method name="RequestRename" tp:name-for-bindings="Request_Rename"> - <arg direction="in" name="Identifier" type="s"> - <tp:docstring> - The desired identifier - </tp:docstring> - </arg> - <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> - <p>Request that the user's own identifier is changed on the server. - If successful, a <tp:member-ref>Renamed</tp:member-ref> signal will - be emitted for the current "self handle" as returned by <tp:dbus-ref - namespace="org.freedesktop.Telepathy.Connection">GetSelfHandle</tp:dbus-ref>.</p> - <p>It is protocol-dependent how the identifier that's actually - used will be derived from the supplied identifier; some sort of - normalization might take place.</p> - </tp:docstring> - <tp:possible-errors> - <tp:error name="org.freedesktop.Telepathy.Error.Disconnected"/> - <tp:error name="org.freedesktop.Telepathy.Error.NetworkError"/> - <tp:error name="org.freedesktop.Telepathy.Error.NotAvailable"/> - <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument"/> - <tp:error name="org.freedesktop.Telepathy.Error.PermissionDenied"/> - </tp:possible-errors> - </method> - <tp:docstring> - An interface on connections to support protocols where the unique - identifiers of contacts can change. Because handles are immutable, - this is represented by a pair of handles, that representing the - old name, and that representing the new one. - </tp:docstring> - </interface> -</node> -<!-- vim:set sw=2 sts=2 et ft=xml: --> diff --git a/extensions/Makefile.am b/extensions/Makefile.am index a9a4d3f..b4d67f8 100644 --- a/extensions/Makefile.am +++ b/extensions/Makefile.am @@ -3,7 +3,6 @@ tools_dir = $(top_srcdir)/tools EXTRA_DIST = \ all.xml \ Connection_Interface_IRC_Command1.xml \ - Connection_Interface_Renaming.xml \ $(NULL) noinst_LTLIBRARIES = libidle-extensions.la diff --git a/extensions/all.xml b/extensions/all.xml index d362c78..6b76837 100644 --- a/extensions/all.xml +++ b/extensions/all.xml @@ -22,7 +22,6 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</p> </tp:license> -<xi:include href="Connection_Interface_Renaming.xml"/> <xi:include href="Connection_Interface_IRC_Command1.xml"/> <tp:generic-types> diff --git a/src/idle-connection.c b/src/idle-connection.c index d99ed91..6f61e6b 100644 --- a/src/idle-connection.c +++ b/src/idle-connection.c @@ -41,7 +41,7 @@ #include "idle-server-connection.h" #include "server-tls-manager.h" -#include "extensions/extensions.h" /* Renaming */ +#include "extensions/extensions.h" /* IRCCommand */ #define DEFAULT_KEEPALIVE_INTERVAL 30 /* sec */ #define MISSED_KEEPALIVES_BEFORE_DISCONNECTING 3 @@ -70,7 +70,7 @@ static void irc_command_iface_init(gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE(IdleConnection, idle_connection, TP_TYPE_BASE_CONNECTION, G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CONNECTION_INTERFACE_ALIASING, _aliasing_iface_init); G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_INFO, idle_contact_info_iface_init); - G_IMPLEMENT_INTERFACE(IDLE_TYPE_SVC_CONNECTION_INTERFACE_RENAMING, _renaming_iface_init); + G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CONNECTION_INTERFACE_RENAMING, _renaming_iface_init); G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACTS, tp_contacts_mixin_iface_init); G_IMPLEMENT_INTERFACE(IDLE_TYPE_SVC_CONNECTION_INTERFACE_IRC_COMMAND1, irc_command_iface_init); ); @@ -452,7 +452,7 @@ static void idle_connection_finalize (GObject *object) { static const gchar * interfaces_always_present[] = { TP_IFACE_CONNECTION_INTERFACE_ALIASING, TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO, - IDLE_IFACE_CONNECTION_INTERFACE_RENAMING, + TP_IFACE_CONNECTION_INTERFACE_RENAMING, TP_IFACE_CONNECTION_INTERFACE_REQUESTS, TP_IFACE_CONNECTION_INTERFACE_CONTACTS, NULL}; @@ -1085,7 +1085,7 @@ static IdleParserHandlerResult _nick_handler(IdleParser *parser, IdleParserMessa tp_base_connection_set_self_handle(TP_BASE_CONNECTION(conn), new_handle); } - idle_svc_connection_interface_renaming_emit_renamed(IDLE_SVC_CONNECTION_INTERFACE_RENAMING(conn), old_handle, new_handle); + tp_svc_connection_interface_renaming_emit_renamed(conn, old_handle, new_handle); idle_connection_emit_queued_aliases_changed(conn); @@ -1433,11 +1433,15 @@ static gboolean _send_rename_request(IdleConnection *obj, const gchar *nick, DBu return TRUE; } -static void idle_connection_request_rename(IdleSvcConnectionInterfaceRenaming *iface, const gchar *nick, DBusGMethodInvocation *context) { +static void +idle_connection_request_rename (TpSvcConnectionInterfaceRenaming *iface, + const gchar *nick, + DBusGMethodInvocation *context) +{ IdleConnection *conn = IDLE_CONNECTION(iface); if (_send_rename_request(conn, nick, context)) - idle_svc_connection_interface_renaming_return_from_request_rename(context); + tp_svc_connection_interface_renaming_return_from_request_rename(context); } static void idle_connection_set_aliases(TpSvcConnectionInterfaceAliasing *iface, GHashTable *aliases, DBusGMethodInvocation *context) { @@ -1563,9 +1567,9 @@ static void _aliasing_iface_init(gpointer g_iface, gpointer iface_data) { } static void _renaming_iface_init(gpointer g_iface, gpointer iface_data) { - IdleSvcConnectionInterfaceRenamingClass *klass = (IdleSvcConnectionInterfaceRenamingClass *) g_iface; + TpSvcConnectionInterfaceRenamingClass *klass = g_iface; -#define IMPLEMENT(x) idle_svc_connection_interface_renaming_implement_##x (\ +#define IMPLEMENT(x) tp_svc_connection_interface_renaming_implement_##x (\ klass, idle_connection_##x) IMPLEMENT(request_rename); #undef IMPLEMENT |