diff options
Diffstat (limited to 'src/ui/core.c')
-rw-r--r-- | src/ui/core.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/ui/core.c b/src/ui/core.c index 1e13de68..3186aba5 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -567,6 +567,44 @@ ui_close_connected_win(int index) } } +int +ui_close_all_wins(void) +{ + int curr = 0, count = 0; + jabber_conn_status_t conn_status = jabber_get_connection_status(); + + for (curr = 1; curr <= 9; curr++) { + if (ui_win_exists(curr)) { + if (conn_status == JABBER_CONNECTED) { + ui_close_connected_win(curr); + } + ui_close_win(curr); + count++; + } + } + + return count; +} + +int +ui_close_read_wins(void) +{ + int curr = 0, count = 0; + jabber_conn_status_t conn_status = jabber_get_connection_status(); + + for (curr = 1; curr <= 9; curr++) { + if (ui_win_exists(curr) && (ui_win_unread(curr) == 0)) { + if (conn_status == JABBER_CONNECTED) { + ui_close_connected_win(curr); + } + ui_close_win(curr); + count++; + } + } + + return count; +} + void ui_switch_win(const int i) { |