about summary refs log tree commit diff stats
path: root/src/ui_windows.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-01-31 00:40:27 +0000
committerJames Booth <boothj5@gmail.com>2013-01-31 00:40:27 +0000
commit06abe13f196638e7e9ee0a0b293a82f2a4d6ad66 (patch)
tree5f84ec95d35a594094a3d17fd80e2ee3d87cbb3a /src/ui_windows.c
parente6749d669db500942d9ad44df34077de34a36580 (diff)
downloadprofani-tty-06abe13f196638e7e9ee0a0b293a82f2a4d6ad66.tar.gz
Show current presence when logging in
Also show correct presence in title bar upon login
Diffstat (limited to 'src/ui_windows.c')
-rw-r--r--src/ui_windows.c34
1 files changed, 34 insertions, 0 deletions
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
@@ -1084,6 +1084,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)
 {
     int i = 0;