[empathy] Chat command nick modified to use RequestRename instead of SetAliases



commit 876df65bb9a150cffcd67f22ade017d3dd7fcb6a
Author: Chandni Verma <chandniverma2112 gmail com>
Date:   Wed Jan 12 16:58:27 2011 +0530

    Chat command nick modified to use RequestRename instead of SetAliases

 libempathy-gtk/empathy-chat.c |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index f98fc30..4b3bcb4 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -775,23 +775,27 @@ chat_command_msg (EmpathyChat *chat,
 #endif
 
 static void
+callback_for_request_rename(TpProxy *proxy,
+		  const GError *error,
+		  gpointer user_data,
+		  GObject *weak_object)
+{
+	if (error != NULL) {
+		DEBUG ("Call to RequestRename method failed: %s",error->message);
+	}
+}
+
+static void
 chat_command_nick (EmpathyChat *chat,
 		   GStrv        strv)
 {
 	EmpathyChatPriv *priv = GET_PRIV (chat);
-	TpConnection *connection;
-	GHashTable *new_alias;
-	TpHandle handle;
-
-	connection = tp_account_get_connection (priv->account);
-	handle = tp_connection_get_self_handle (connection);
-	new_alias = g_hash_table_new (g_direct_hash, g_direct_equal);
-	g_hash_table_insert (new_alias, GUINT_TO_POINTER (handle), strv[1]);
+	TpProxy *proxy;
 
-	tp_cli_connection_interface_aliasing_call_set_aliases (connection, -1,
-		new_alias, NULL, NULL, NULL, NULL);
+	proxy = TP_PROXY (tp_account_get_connection (priv->account));
 
-	g_hash_table_destroy (new_alias);
+	emp_cli_connection_interface_renaming_call_request_rename (proxy, -1,
+		strv[1], callback_for_request_rename, NULL, NULL, NULL);
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]