From 996ba8181be0eece76985dc866daea5b6797e62b Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 21 Apr 2013 01:18:04 +0100 Subject: [PATCH] Moved cons_show_account_list() to console module --- src/ui/console.c | 36 ++++++++++++++++++++++++++++++++++++ src/ui/windows.c | 26 -------------------------- 2 files changed, 36 insertions(+), 26 deletions(-) diff --git a/src/ui/console.c b/src/ui/console.c index 05be9928..13a379ab 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -625,6 +625,42 @@ cons_show_room_invite(const char * const invitor, const char * const room, jid_destroy(room_jid); g_string_free(default_service, TRUE); + + dirty = TRUE; + if (!win_current_is_console()) { + status_bar_new(0); + } +} + +void +cons_show_account_list(gchar **accounts) +{ + int size = g_strv_length(accounts); + if (size > 0) { + cons_show("Accounts:"); + int i = 0; + for (i = 0; i < size; i++) { + if ((jabber_get_connection_status() == JABBER_CONNECTED) && + (g_strcmp0(jabber_get_account_name(), accounts[i]) == 0)) { + resource_presence_t presence = accounts_get_last_presence(accounts[i]); + window_show_time(console, '-'); + window_presence_colour_on(console, string_from_resource_presence(presence)); + wprintw(console->win, "%s\n", accounts[i]); + window_presence_colour_off(console, string_from_resource_presence(presence)); + } else { + cons_show(accounts[i]); + } + } + cons_show(""); + } else { + cons_show("No accounts created yet."); + cons_show(""); + } + + dirty = TRUE; + if (!win_current_is_console()) { + status_bar_new(0); + } } static void diff --git a/src/ui/windows.c b/src/ui/windows.c index f9cd343b..b1820dba 100644 --- a/src/ui/windows.c +++ b/src/ui/windows.c @@ -1105,32 +1105,6 @@ win_show_room_broadcast(const char * const room_jid, const char * const message) } } -void -cons_show_account_list(gchar **accounts) -{ - int size = g_strv_length(accounts); - if (size > 0) { - cons_show("Accounts:"); - int i = 0; - for (i = 0; i < size; i++) { - if ((jabber_get_connection_status() == JABBER_CONNECTED) && - (g_strcmp0(jabber_get_account_name(), accounts[i]) == 0)) { - resource_presence_t presence = accounts_get_last_presence(accounts[i]); - window_show_time(console, '-'); - window_presence_colour_on(console, string_from_resource_presence(presence)); - wprintw(console->win, "%s\n", accounts[i]); - window_presence_colour_off(console, string_from_resource_presence(presence)); - } else { - cons_show(accounts[i]); - } - } - cons_show(""); - } else { - cons_show("No accounts created yet."); - cons_show(""); - } -} - void cons_show_account(ProfAccount *account) {