about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/command.c3
-rw-r--r--src/ui.h1
-rw-r--r--src/windows.c6
3 files changed, 8 insertions, 2 deletions
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
@@ -550,6 +550,12 @@ win_current_close(void)
 }
 
 int
+win_current_is_console(void)
+{
+    return (current->type == WIN_CONSOLE);
+}
+
+int
 win_current_is_chat(void)
 {
     return (current->type == WIN_CHAT);