aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2009-11-14 05:36:48 +0800
committerXavier Claessens <xclaesse@gmail.com>2009-11-14 05:47:15 +0800
commit8523d53b5c5a88c2581ca15d92e253c9d3bc38bf (patch)
tree96147e63b0a8bef7a8c16943dd21c033f15ab6e7
parenta9c15cf0385c3c7d3a73ab18e7fdced3365440bb (diff)
downloadgsoc2013-empathy-8523d53b5c5a88c2581ca15d92e253c9d3bc38bf.tar
gsoc2013-empathy-8523d53b5c5a88c2581ca15d92e253c9d3bc38bf.tar.gz
gsoc2013-empathy-8523d53b5c5a88c2581ca15d92e253c9d3bc38bf.tar.bz2
gsoc2013-empathy-8523d53b5c5a88c2581ca15d92e253c9d3bc38bf.tar.lz
gsoc2013-empathy-8523d53b5c5a88c2581ca15d92e253c9d3bc38bf.tar.xz
gsoc2013-empathy-8523d53b5c5a88c2581ca15d92e253c9d3bc38bf.tar.zst
gsoc2013-empathy-8523d53b5c5a88c2581ca15d92e253c9d3bc38bf.zip
Implement /nick command
-rw-r--r--libempathy-gtk/empathy-chat.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 62b3d437b..67c8426cb 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -712,6 +712,26 @@ chat_command_msg (EmpathyChat *chat,
}
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]);
+
+ tp_cli_connection_interface_aliasing_call_set_aliases (connection, -1,
+ new_alias, NULL, NULL, NULL, NULL);
+
+ g_hash_table_destroy (new_alias);
+}
+
+static void
chat_command_me (EmpathyChat *chat,
GStrv strv)
{
@@ -767,6 +787,9 @@ static ChatCommandItem commands[] = {
{"msg", 3, 3, chat_command_msg,
N_("/msg <contact id> <message>, open a private chat")},
+ {"nick", 2, 2, chat_command_nick,
+ N_("/nick <nickname>, change your nickname on current server")},
+
{"me", 2, 2, chat_command_me,
N_("/me <message>, send an ACTION message to the current conversation")},