From f468afa9675ccbfbecb6cc5de1609783f9b9c136 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 4 Feb 2014 13:42:08 +0100 Subject: [PATCH] Renaming: use tp-glib API instead of generating it as an extension --- extensions/Connection_Interface_Renaming.xml | 98 -------------------- extensions/Makefile.am | 1 - extensions/misc.xml | 1 - libempathy-gtk/empathy-chat.c | 11 +-- 4 files changed, 5 insertions(+), 106 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 d08b748d..00000000 --- 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 f72c407c..2ec034c4 100644 --- a/extensions/Makefile.am +++ b/extensions/Makefile.am @@ -13,7 +13,6 @@ EXTRA_DIST = \ generic-types.xml \ misc.xml \ Logger.xml \ - Connection_Interface_Renaming.xml \ Channel_Interface_Credentials_Storage.xml \ Chat_Manager.xml \ $(NULL) diff --git a/extensions/misc.xml b/extensions/misc.xml index f2f15b03..b6247c95 100644 --- a/extensions/misc.xml +++ b/extensions/misc.xml @@ -6,7 +6,6 @@ - diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index 35f908b7..2b5657e8 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -51,7 +51,6 @@ #include "empathy-theme-manager.h" #include "empathy-ui-utils.h" #include "empathy-utils.h" -#include "extensions.h" #define DEBUG_FLAG EMPATHY_DEBUG_CHAT #include "empathy-debug.h" @@ -761,7 +760,7 @@ nick_command_supported (EmpathyChat *chat) connection = tp_channel_get_connection (TP_CHANNEL (priv->tp_chat)); return tp_proxy_has_interface_by_id (connection, - EMP_IFACE_QUARK_CONNECTION_INTERFACE_RENAMING); + TP_IFACE_QUARK_CONNECTION_INTERFACE_RENAMING); } static gboolean @@ -888,7 +887,7 @@ chat_command_msg (EmpathyChat *chat, } static void -callback_for_request_rename (TpProxy *proxy, +callback_for_request_rename (TpConnection *conn, const GError *error, gpointer user_data, GObject *weak_object) @@ -903,11 +902,11 @@ chat_command_nick (EmpathyChat *chat, GStrv strv) { EmpathyChatPriv *priv = GET_PRIV (chat); - TpProxy *proxy; + TpConnection *conn; - proxy = TP_PROXY (tp_account_get_connection (priv->account)); + conn = tp_account_get_connection (priv->account); - emp_cli_connection_interface_renaming_call_request_rename (proxy, -1, + tp_cli_connection_interface_renaming_call_request_rename (conn, -1, strv[1], callback_for_request_rename, NULL, NULL, NULL); } -- 2.39.2