about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-10-06 00:38:29 +0100
committerJames Booth <boothj5@gmail.com>2014-10-06 00:38:29 +0100
commit2aeaad230e0095216c6a226ab4da8b03b3198e81 (patch)
tree68d5e96d96449ed54a8d37d15979107aee92bd97 /src/command
parentd12534c58e5c466d2b9443e196df151205c2b879 (diff)
downloadprofani-tty-2aeaad230e0095216c6a226ab4da8b03b3198e81.tar.gz
Allow setting "none" affiliation
Diffstat (limited to 'src/command')
-rw-r--r--src/command/command.c1
-rw-r--r--src/command/commands.c7
2 files changed, 7 insertions, 1 deletions
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;
         }