about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-04-19 00:56:57 +0100
committerJames Booth <boothj5@gmail.com>2014-04-19 00:56:57 +0100
commite830e2a06a43b03377c9bb862b1843aec91cb366 (patch)
tree45b2bf5b40a27591e055e3818d3c583e0068046e
parent71aea78e90da371ca3a290f3bcd1925a7bdbcba1 (diff)
downloadprofani-tty-e830e2a06a43b03377c9bb862b1843aec91cb366.tar.gz
Show message in console when contact starts OTR session
-rw-r--r--src/otr/otr.c2
-rw-r--r--src/ui/core.c11
2 files changed, 12 insertions, 1 deletions
diff --git a/src/otr/otr.c b/src/otr/otr.c
index 73ce8966..5424b09a 100644
--- a/src/otr/otr.c
+++ b/src/otr/otr.c
@@ -59,7 +59,7 @@ cb_is_logged_in(void *opdata, const char *accountname,
         return PRESENCE_ONLINE;
     }
 
-    // no subsribed
+    // not subscribed
     if (p_contact_subscribed(contact) == FALSE) {
         return PRESENCE_ONLINE;
     }
diff --git a/src/ui/core.c b/src/ui/core.c
index 6e7b992a..a84d5856 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -771,6 +771,17 @@ _ui_gone_secure(const char * const recipient, gboolean trusted)
     } else {
         int num = wins_get_num(window);
         status_bar_new(num);
+
+        int ui_index = num;
+        if (ui_index == 10) {
+            ui_index = 0;
+        }
+        cons_show("%s started an OTR session (%d).", recipient, ui_index);
+        ProfWin *console = wins_get_console();
+        if (wins_is_current(console)) {
+            ui_current_page_off();
+        }
+        cons_alert();
     }
 }