From 2aeaad230e0095216c6a226ab4da8b03b3198e81 Mon Sep 17 00:00:00 2001 From: James Booth Date: Mon, 6 Oct 2014 00:38:29 +0100 Subject: [PATCH] Allow setting "none" affiliation --- src/command/command.c | 1 + src/command/commands.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/command/command.c b/src/command/command.c index 90f168d1..5f44b6d4 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -1259,6 +1259,7 @@ cmd_init(void) autocomplete_add(room_affiliation_ac, "owner"); autocomplete_add(room_affiliation_ac, "admin"); autocomplete_add(room_affiliation_ac, "member"); + autocomplete_add(room_affiliation_ac, "none"); autocomplete_add(room_affiliation_ac, "outcast"); room_role_ac = autocomplete_new(); diff --git a/src/command/commands.c b/src/command/commands.c index 39981b5f..7678f2c1 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -2206,13 +2206,18 @@ cmd_room(gchar **args, struct cmd_help_t help) if ((g_strcmp0(affiliation, "owner") != 0) && (g_strcmp0(affiliation, "admin") != 0) && (g_strcmp0(affiliation, "member") != 0) && + (g_strcmp0(affiliation, "none") != 0) && (g_strcmp0(affiliation, "outcast") != 0)) { cons_show("Usage: %s", help.usage); return TRUE; } if (g_strcmp0(cmd, "list") == 0) { - iq_room_affiliation_list(room, affiliation); + if (g_strcmp0(affiliation, "none") == 0) { + win_save_print(window, '!', NULL, 0, 0, "", "Cannot list users with no affiliation."); + } else { + iq_room_affiliation_list(room, affiliation); + } return TRUE; }