diff options
author | James Booth <boothj5@gmail.com> | 2014-09-28 01:55:24 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-09-28 01:55:24 +0100 |
commit | 41b49cb5d6507636070c4d65f0e3f006c1ac9952 (patch) | |
tree | b99b0190a148d8b297561e95695db7695339fdc0 /src/command | |
parent | a4f7932ed7dc35aa1a706d1b889c26da079963bb (diff) | |
download | profani-tty-41b49cb5d6507636070c4d65f0e3f006c1ac9952.tar.gz |
Store room affiliation and role
Diffstat (limited to 'src/command')
-rw-r--r-- | src/command/command.c | 8 | ||||
-rw-r--r-- | src/command/commands.c | 10 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/command/command.c b/src/command/command.c index bee26eff..b937aea2 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -307,12 +307,13 @@ static struct cmd_t command_defs[] = { "/room", cmd_room, parse_args, 1, 1, NULL, - { "/room accept|destroy|config", "Room configuration.", - { "/room accept|destroy|config", - "---------------------------", + { "/room accept|destroy|config|info", "Room configuration.", + { "/room accept|destroy|config|info", + "--------------------------------", "accept - Accept default room configuration.", "destroy - Reject default room configuration.", "config - Edit room configuration.", + "info - Show room details.", NULL } } }, { "/form", @@ -1226,6 +1227,7 @@ cmd_init(void) autocomplete_add(room_ac, "accept"); autocomplete_add(room_ac, "destroy"); autocomplete_add(room_ac, "config"); + autocomplete_add(room_ac, "info"); form_ac = autocomplete_new(); autocomplete_add(form_ac, "submit"); diff --git a/src/command/commands.c b/src/command/commands.c index 045ad00a..1551f58c 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -2083,7 +2083,8 @@ cmd_room(gchar **args, struct cmd_help_t help) if ((g_strcmp0(args[0], "accept") != 0) && (g_strcmp0(args[0], "destroy") != 0) && - (g_strcmp0(args[0], "config") != 0)) { + (g_strcmp0(args[0], "config") != 0) && + (g_strcmp0(args[0], "info") != 0)) { cons_show("Usage: %s", help.usage); return TRUE; } @@ -2097,6 +2098,13 @@ cmd_room(gchar **args, struct cmd_help_t help) ui_index = 0; } + if (g_strcmp0(args[0], "info") == 0) { + char *role = muc_get_role_str(room); + char *affiliation = muc_get_affiliation_str(room); + ui_current_print_line("Affiliation: %s, Role: %s", affiliation, role); + return TRUE; + } + if (g_strcmp0(args[0], "accept") == 0) { gboolean requires_config = muc_requires_config(room); if (!requires_config) { |