diff options
author | James Booth <boothj5@gmail.com> | 2014-10-06 23:17:40 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-10-06 23:17:40 +0100 |
commit | 3228746827d61e32b6938086d1d087fe2bbb9d6f (patch) | |
tree | 61e8cd6ee769bd0036e8e7bc458da256f0dcb58b | |
parent | 78a1556f1205d0d2ad2f9a5e7a29c4515defa128 (diff) | |
download | profani-tty-3228746827d61e32b6938086d1d087fe2bbb9d6f.tar.gz |
Added /room ban command
-rw-r--r-- | src/command/command.c | 8 | ||||
-rw-r--r-- | src/command/commands.c | 12 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/command/command.c b/src/command/command.c index 9c4fd746..b4fc5645 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -1252,6 +1252,7 @@ cmd_init(void) autocomplete_add(room_ac, "info"); autocomplete_add(room_ac, "subject"); autocomplete_add(room_ac, "kick"); + autocomplete_add(room_ac, "ban"); autocomplete_add(room_ac, "role"); autocomplete_add(room_ac, "affiliation"); @@ -2355,6 +2356,13 @@ _room_autocomplete(char *input, int *size) } } + if (jid_ac != NULL) { + result = autocomplete_param_with_ac(input, size, "/room ban", jid_ac, TRUE); + if (result != NULL) { + return result; + } + } + result = autocomplete_param_with_ac(input, size, "/room", room_ac, TRUE); if (result != NULL) { return result; diff --git a/src/command/commands.c b/src/command/commands.c index f1fff045..ff202df4 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -2128,6 +2128,7 @@ cmd_room(gchar **args, struct cmd_help_t help) (g_strcmp0(args[0], "config") != 0) && (g_strcmp0(args[0], "subject") != 0) && (g_strcmp0(args[0], "kick") != 0) && + (g_strcmp0(args[0], "ban") != 0) && (g_strcmp0(args[0], "role") != 0) && (g_strcmp0(args[0], "affiliation") != 0) && (g_strcmp0(args[0], "info") != 0)) { @@ -2195,6 +2196,17 @@ cmd_room(gchar **args, struct cmd_help_t help) return TRUE; } + if (g_strcmp0(args[0], "ban") == 0) { + char *jid = args[1]; + if (jid) { + char *reason = args[2]; + iq_room_affiliation_set(room, jid, "outcast", reason); + } else { + cons_show("Usage: %s", help.usage); + } + return TRUE; + } + if (g_strcmp0(args[0], "affiliation") == 0) { char *cmd = args[1]; if (cmd == NULL) { |