1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

cmd_room: don't check arguments twice

This commit is contained in:
Michael Vetter 2019-11-08 13:00:31 +01:00
parent b846c4970b
commit cbd85ffd1a

View File

@ -4329,13 +4329,6 @@ cmd_room(ProfWin *window, const char *const command, gchar **args)
return TRUE; return TRUE;
} }
if ((g_strcmp0(args[0], "accept") != 0) &&
(g_strcmp0(args[0], "destroy") != 0) &&
(g_strcmp0(args[0], "config") != 0)) {
cons_bad_cmd_usage(command);
return TRUE;
}
ProfMucWin *mucwin = (ProfMucWin*)window; ProfMucWin *mucwin = (ProfMucWin*)window;
assert(mucwin->memcheck == PROFMUCWIN_MEMCHECK); assert(mucwin->memcheck == PROFMUCWIN_MEMCHECK);
@ -4350,14 +4343,10 @@ cmd_room(ProfWin *window, const char *const command, gchar **args)
win_println(window, THEME_ROOMINFO, '!', "Room unlocked."); win_println(window, THEME_ROOMINFO, '!', "Room unlocked.");
return TRUE; return TRUE;
} }
} } else if (g_strcmp0(args[0], "destroy") == 0) {
if (g_strcmp0(args[0], "destroy") == 0) {
iq_destroy_room(mucwin->roomjid); iq_destroy_room(mucwin->roomjid);
return TRUE; return TRUE;
} } else if (g_strcmp0(args[0], "config") == 0) {
if (g_strcmp0(args[0], "config") == 0) {
ProfConfWin *confwin = wins_get_conf(mucwin->roomjid); ProfConfWin *confwin = wins_get_conf(mucwin->roomjid);
if (confwin) { if (confwin) {
@ -4366,6 +4355,8 @@ cmd_room(ProfWin *window, const char *const command, gchar **args)
iq_request_room_config_form(mucwin->roomjid); iq_request_room_config_form(mucwin->roomjid);
} }
return TRUE; return TRUE;
} else {
cons_bad_cmd_usage(command);
} }
return TRUE; return TRUE;