about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-01-11 01:05:59 +0000
committerJames Booth <boothj5@gmail.com>2013-01-11 01:05:59 +0000
commit1cc5353697ddf3e5b441238ffe2d814d5d2e95b9 (patch)
treec9825003a725f7bb10f2296ba0e912c3f9d38b0a /src
parent62c102860c48bff5ceb9e7c701173de6749b49ee (diff)
downloadprofani-tty-1cc5353697ddf3e5b441238ffe2d814d5d2e95b9.tar.gz
Added win_current_is_console()
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);