Mercurial > hg
diff mcabber/src/commands.c @ 599:fb67bf62f4eb
Add "/room destroy"
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Tue, 13 Dec 2005 23:40:17 +0100 |
parents | a3db3ee8b99e |
children | 483a87c99990 |
line wrap: on
line diff
--- a/mcabber/src/commands.c Tue Dec 13 23:04:09 2005 +0100 +++ b/mcabber/src/commands.c Tue Dec 13 23:40:17 2005 +0100 @@ -158,6 +158,7 @@ // Room category compl_add_category_word(COMPL_ROOM, "affil"); compl_add_category_word(COMPL_ROOM, "ban"); + compl_add_category_word(COMPL_ROOM, "destroy"); compl_add_category_word(COMPL_ROOM, "invite"); compl_add_category_word(COMPL_ROOM, "join"); compl_add_category_word(COMPL_ROOM, "kick"); @@ -1457,6 +1458,18 @@ g_free(msg); } +static void room_destroy(gpointer bud, char *arg) +{ + gchar *msg; + + if (arg && *arg) + msg = arg; + else + msg = NULL; + + jb_room_destroy(buddy_getjid(bud), NULL, msg); +} + static void room_unlock(gpointer bud, char *arg) { if (*arg) { @@ -1589,6 +1602,9 @@ } else if (!strcasecmp(subcmd, "remove")) { if ((arg = check_room_subcommand(arg, FALSE, bud)) != NULL) room_remove(bud, arg); + } else if (!strcasecmp(subcmd, "destroy")) { + if ((arg = check_room_subcommand(arg, FALSE, bud)) != NULL) + room_destroy(bud, arg); } else if (!strcasecmp(subcmd, "unlock")) { if ((arg = check_room_subcommand(arg, FALSE, bud)) != NULL) room_unlock(bud, arg);