about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-10-11 23:37:04 +0100
committerJames Booth <boothj5@gmail.com>2014-10-11 23:37:04 +0100
commitc66d03539dbe0019149a51e6aa0c68c5d5acb394 (patch)
tree59af07d22907b00cf5f3a17232ad0204308ed22a /src/command
parent8b77f527c0184f1780a021e77b966f6441ae90ac (diff)
downloadprofani-tty-c66d03539dbe0019149a51e6aa0c68c5d5acb394.tar.gz
Removed /room info command, covered by /info
Diffstat (limited to 'src/command')
-rw-r--r--src/command/command.c1
-rw-r--r--src/command/commands.c16
2 files changed, 7 insertions, 10 deletions
diff --git a/src/command/command.c b/src/command/command.c
index e8697920..b131dcf9 100644
--- a/src/command/command.c
+++ b/src/command/command.c
@@ -1291,7 +1291,6 @@ cmd_init(void)
     autocomplete_add(room_ac, "accept");
     autocomplete_add(room_ac, "destroy");
     autocomplete_add(room_ac, "config");
-    autocomplete_add(room_ac, "info");
     autocomplete_add(room_ac, "role");
     autocomplete_add(room_ac, "affiliation");
 
diff --git a/src/command/commands.c b/src/command/commands.c
index 3f927407..89afc05c 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -1501,6 +1501,7 @@ cmd_info(gchar **args, struct cmd_help_t help)
     win_type_t win_type = ui_current_win_type();
     PContact pcontact = NULL;
     Occupant *occupant = NULL;
+    char *room = NULL;
 
     if (conn_status != JABBER_CONNECTED) {
         cons_show("You are not currently connected.");
@@ -1510,6 +1511,7 @@ cmd_info(gchar **args, struct cmd_help_t help)
     switch (win_type)
     {
         case WIN_MUC:
+            room = ui_current_recipient();
             if (usr) {
                 char *room = ui_current_recipient();
                 occupant = muc_roster_item(room, usr);
@@ -1519,7 +1521,10 @@ cmd_info(gchar **args, struct cmd_help_t help)
                     ui_current_print_line("No such occupant \"%s\" in room.", usr);
                 }
             } else {
-                ui_current_print_line("You must specify a nickname.");
+                ProfWin *window = wins_get_by_recipient(room);
+                iq_room_info_request(room);
+                ui_show_room_info(window, room);
+                return TRUE;
             }
             break;
         case WIN_CHAT:
@@ -2237,8 +2242,7 @@ cmd_room(gchar **args, struct cmd_help_t help)
             (g_strcmp0(args[0], "destroy") != 0) &&
             (g_strcmp0(args[0], "config") != 0) &&
             (g_strcmp0(args[0], "role") != 0) &&
-            (g_strcmp0(args[0], "affiliation") != 0) &&
-            (g_strcmp0(args[0], "info") != 0)) {
+            (g_strcmp0(args[0], "affiliation") != 0)) {
         cons_show("Usage: %s", help.usage);
         return TRUE;
     }
@@ -2252,12 +2256,6 @@ cmd_room(gchar **args, struct cmd_help_t help)
         ui_index = 0;
     }
 
-    if (g_strcmp0(args[0], "info") == 0) {
-        iq_room_info_request(room);
-        ui_show_room_info(window, room);
-        return TRUE;
-    }
-
     if (g_strcmp0(args[0], "affiliation") == 0) {
         char *cmd = args[1];
         if (cmd == NULL) {