about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/windows.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/windows.c b/src/windows.c
index 6efc9e19..269339c6 100644
--- a/src/windows.c
+++ b/src/windows.c
@@ -123,6 +123,21 @@ ui_init(void)
 void
 ui_refresh(void)
 {
+    jabber_conn_status_t status = jabber_get_connection_status();
+
+    if (status == JABBER_CONNECTED) {
+        const char * const jid = jabber_get_jid();
+        gint unread = _win_get_unread();
+
+        if (unread != 0) {
+            printf("%c]0;*%s - %s (%d unread)%c", '\033', "Profanity", jid, unread, '\007');
+        } else {
+            printf("%c]0;%s - %s%c", '\033', "Profanity", jid, '\007');
+        }
+    } else {
+        printf("%c]0;%s%c", '\033', "Profanity", '\007');
+    }
+
     title_bar_refresh();
     status_bar_refresh();