about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
Diffstat (limited to 'src/command')
-rw-r--r--src/command/command.c8
-rw-r--r--src/command/commands.c10
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) {