diff --git a/src/command.c b/src/command.c index 6fbcb6c5..9310c7d9 100644 --- a/src/command.c +++ b/src/command.c @@ -1661,8 +1661,7 @@ _cmd_close(gchar **args, struct cmd_help_t help) jabber_conn_status_t conn_status = jabber_get_connection_status(); // cannot close console window - if (!win_current_is_chat() && !win_current_is_groupchat() - && !win_current_is_private()) { + if (win_current_is_console()) { cons_show("Cannot close console window."); return TRUE; } diff --git a/src/ui.h b/src/ui.h index 22b78893..77e51ed7 100644 --- a/src/ui.h +++ b/src/ui.h @@ -97,6 +97,7 @@ void title_bar_draw(void); // current window actions void win_current_close(void); +int win_current_is_console(void); int win_current_is_chat(void); int win_current_is_groupchat(void); int win_current_is_private(void); diff --git a/src/windows.c b/src/windows.c index 0ceab11c..addae801 100644 --- a/src/windows.c +++ b/src/windows.c @@ -549,6 +549,12 @@ win_current_close(void) dirty = TRUE; } +int +win_current_is_console(void) +{ + return (current->type == WIN_CONSOLE); +} + int win_current_is_chat(void) {