diff mcabber/src/commands.c @ 470:eaa2ad773192

Add "/room nick"
author Mikael Berthe <mikael@lilotux.net>
date Sun, 02 Oct 2005 00:37:16 +0200
parents a926523d2392
children 82a27508fb85
line wrap: on
line diff
--- a/mcabber/src/commands.c	Sat Oct 01 23:17:05 2005 +0200
+++ b/mcabber/src/commands.c	Sun Oct 02 00:37:16 2005 +0200
@@ -154,6 +154,7 @@
   compl_add_category_word(COMPL_ROOM, "join");
   compl_add_category_word(COMPL_ROOM, "leave");
   compl_add_category_word(COMPL_ROOM, "names");
+  compl_add_category_word(COMPL_ROOM, "nick");
   compl_add_category_word(COMPL_ROOM, "remove");
   compl_add_category_word(COMPL_ROOM, "unlock");
 }
@@ -1017,6 +1018,22 @@
       return;
     }
     do_info(NULL);
+  } else if (!strncasecmp(arg, "nick", 4))  {
+    gchar *cmd;
+    arg += 4;
+    if (*arg++ != ' ') {
+      scr_LogPrint(LPRINT_NORMAL, "Wrong or missing parameter");
+      return;
+    }
+    for (; *arg && *arg == ' '; arg++)
+      ;
+    if (!(buddy_gettype(bud) & ROSTER_TYPE_ROOM)) {
+      scr_LogPrint(LPRINT_NORMAL, "This isn't a chatroom");
+      return;
+    }
+    cmd = g_strdup_printf("join %s %s", buddy_getjid(bud), arg);
+    do_room(cmd);
+    g_free(cmd);
   } else if (!strcasecmp(arg, "remove"))  {
     if (!(buddy_gettype(bud) & ROSTER_TYPE_ROOM)) {
       scr_LogPrint(LPRINT_NORMAL, "This isn't a chatroom");