From 06abe13f196638e7e9ee0a0b293a82f2a4d6ad66 Mon Sep 17 00:00:00 2001 From: James Booth Date: Thu, 31 Jan 2013 00:40:27 +0000 Subject: Show current presence when logging in Also show correct presence in title bar upon login --- src/ui_windows.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'src/ui_windows.c') diff --git a/src/ui_windows.c b/src/ui_windows.c index 26e7a197..b17536e5 100644 --- a/src/ui_windows.c +++ b/src/ui_windows.c @@ -1083,6 +1083,40 @@ win_show_room_broadcast(const char * const room_jid, const char * const message) } } +void +cons_show_login_success(ProfAccount *account) +{ + _win_show_time(console->win, '-'); + wprintw(console->win, "%s logged in successfully, ", account->jid); + + jabber_presence_t presence = accounts_get_login_presence(account->name); + char *presence_str; + switch(presence) + { + case PRESENCE_CHAT: + presence_str = "chat"; + break; + case PRESENCE_AWAY: + presence_str = "away"; + break; + case PRESENCE_XA: + presence_str = "xa"; + break; + case PRESENCE_DND: + presence_str = "dnd"; + break; + default: + presence_str = "online"; + break; + } + + _presence_colour_on(console->win, presence_str); + wprintw(console->win, "%s", presence_str); + _presence_colour_off(console->win, presence_str); + wprintw(console->win, ".\n"); +} + + void cons_show_wins(void) { -- cgit 1.4.1-2-gfad0