1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-10-06 20:03:46 -04:00

Added win_current_is_console()

This commit is contained in:
James Booth 2013-01-11 01:05:59 +00:00
parent 62c102860c
commit 1cc5353697
3 changed files with 8 additions and 2 deletions

View File

@ -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;
}

View File

@ -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);

View File

@ -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)
{