comparison 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
comparison
equal deleted inserted replaced
469:a926523d2392 470:eaa2ad773192
152 152
153 // Room category 153 // Room category
154 compl_add_category_word(COMPL_ROOM, "join"); 154 compl_add_category_word(COMPL_ROOM, "join");
155 compl_add_category_word(COMPL_ROOM, "leave"); 155 compl_add_category_word(COMPL_ROOM, "leave");
156 compl_add_category_word(COMPL_ROOM, "names"); 156 compl_add_category_word(COMPL_ROOM, "names");
157 compl_add_category_word(COMPL_ROOM, "nick");
157 compl_add_category_word(COMPL_ROOM, "remove"); 158 compl_add_category_word(COMPL_ROOM, "remove");
158 compl_add_category_word(COMPL_ROOM, "unlock"); 159 compl_add_category_word(COMPL_ROOM, "unlock");
159 } 160 }
160 161
161 // expandalias(line) 162 // expandalias(line)
1015 if (!(buddy_gettype(bud) & ROSTER_TYPE_ROOM)) { 1016 if (!(buddy_gettype(bud) & ROSTER_TYPE_ROOM)) {
1016 scr_LogPrint(LPRINT_NORMAL, "This isn't a chatroom"); 1017 scr_LogPrint(LPRINT_NORMAL, "This isn't a chatroom");
1017 return; 1018 return;
1018 } 1019 }
1019 do_info(NULL); 1020 do_info(NULL);
1021 } else if (!strncasecmp(arg, "nick", 4)) {
1022 gchar *cmd;
1023 arg += 4;
1024 if (*arg++ != ' ') {
1025 scr_LogPrint(LPRINT_NORMAL, "Wrong or missing parameter");
1026 return;
1027 }
1028 for (; *arg && *arg == ' '; arg++)
1029 ;
1030 if (!(buddy_gettype(bud) & ROSTER_TYPE_ROOM)) {
1031 scr_LogPrint(LPRINT_NORMAL, "This isn't a chatroom");
1032 return;
1033 }
1034 cmd = g_strdup_printf("join %s %s", buddy_getjid(bud), arg);
1035 do_room(cmd);
1036 g_free(cmd);
1020 } else if (!strcasecmp(arg, "remove")) { 1037 } else if (!strcasecmp(arg, "remove")) {
1021 if (!(buddy_gettype(bud) & ROSTER_TYPE_ROOM)) { 1038 if (!(buddy_gettype(bud) & ROSTER_TYPE_ROOM)) {
1022 scr_LogPrint(LPRINT_NORMAL, "This isn't a chatroom"); 1039 scr_LogPrint(LPRINT_NORMAL, "This isn't a chatroom");
1023 return; 1040 return;
1024 } 1041 }