diff options
Diffstat (limited to 'src/command/commands.c')
-rw-r--r-- | src/command/commands.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/command/commands.c b/src/command/commands.c index 17eb9157..8dc351aa 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -1798,7 +1798,7 @@ cmd_room(gchar **args, struct cmd_help_t help) } win_type_t win_type = ui_current_win_type(); - if (win_type != WIN_MUC) { + if (win_type != WIN_MUC && win_type != WIN_MUC_CONFIG) { cons_show("Command /room only usable in chat rooms."); return TRUE; } @@ -1811,6 +1811,7 @@ cmd_room(gchar **args, struct cmd_help_t help) if ((g_strcmp0(args[1], "accept") != 0) && (g_strcmp0(args[1], "cancel") != 0) && (g_strcmp0(args[1], "destroy") != 0) && + (g_strcmp0(args[1], "submit") != 0) && (g_strcmp0(args[1], "edit") != 0)) { cons_show("Usage: %s", help.usage); return TRUE; @@ -1857,6 +1858,20 @@ cmd_room(gchar **args, struct cmd_help_t help) return TRUE; } + if (g_strcmp0(args[1], "submit") == 0) { + ProfWin *current = wins_get_current(); + if (current->type != WIN_MUC_CONFIG) { + cons_show("Room configuration can only be submitted when in the room configuration window."); + return TRUE; + } else { + gchar **split_recipient = g_strsplit(room, " ", 2); + room = split_recipient[0]; + iq_submit_room_config(room, current->form); + g_strfreev(split_recipient); + return TRUE; + } + } + if (g_strcmp0(args[1], "cancel") == 0) { iq_room_config_cancel(room); return TRUE; |