]> git.0d.be Git - empathy.git/commitdiff
Chat command nick modified to use RequestRename instead of SetAliases
authorChandni Verma <chandniverma2112@gmail.com>
Wed, 12 Jan 2011 11:28:27 +0000 (16:58 +0530)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 13 Jan 2011 08:52:24 +0000 (09:52 +0100)
libempathy-gtk/empathy-chat.c

index f98fc302fa13fd965d737c40eb4754059d0fbfc3..4b3bcb4279a6c1b8f4be7196989b3531ffe1b48e 100644 (file)
@@ -774,24 +774,28 @@ 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