From 4ed581ab1bc18402757b3eb0649cf1394e5ffc67 Mon Sep 17 00:00:00 2001
From: Simon McVittie
Date: Tue, 15 Oct 2013 13:28:52 +0100
Subject: [PATCH 3/3] Use telepathy-glib 0.23 for Renaming interface
---
extensions/Connection_Interface_Renaming.xml | 98 ----------------------------
extensions/Makefile.am | 1 -
extensions/all.xml | 1 -
src/idle-connection.c | 20 +++---
4 files changed, 12 insertions(+), 108 deletions(-)
delete mode 100644 extensions/Connection_Interface_Renaming.xml
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 @@
-
-
- Copyright (C) 2005, 2006 Collabora Limited
- Copyright (C) 2005, 2006 Nokia Corporation
- Copyright (C) 2006 INdT
-
- 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.
-
-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.
-
-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.
-
-
-
-
-
-
- The handle of the original identifier
-
-
-
-
- The handle of the new identifier
-
-
-
- Emitted when the unique identifier of a contact on the server
- changes.
-
- 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.
-
- 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.
-
- 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
- MembersChanged
- signal must be emitted after the
- Renamed signal; the reason should be
- RENAMED.
-
-
- 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.
-
-
-
-
-
-
- The desired identifier
-
-
-
- Request that the user's own identifier is changed on the server.
- If successful, a Renamed signal will
- be emitted for the current "self handle" as returned by GetSelfHandle.
- 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.
-
-
-
-
-
-
-
-
-
-
- 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.
-
-
-
-
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
-
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
--
1.8.4.2