about summary refs log tree commit diff stats
path: root/src/ui/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/core.c')
-rw-r--r--src/ui/core.c78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/ui/core.c b/src/ui/core.c
index adebdadd..e59b2fda 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -785,6 +785,78 @@ _ui_gone_secure(const char * const recipient, gboolean trusted)
 }
 
 static void
+_ui_smp_recipient_initiated(const char * const recipient)
+{
+    ProfWin *window = wins_get_by_recipient(recipient);
+    if (window == NULL) {
+        return;
+    } else {
+        win_vprint_line(window, '!', 0, "%s initiated SMP with secret, use '/otr secret <secret>' to start a trusted session.", recipient);
+        win_update_virtual(window);
+    }
+}
+
+static void
+_ui_smp_successful_sender(const char * const recipient)
+{
+    ProfWin *window = wins_get_by_recipient(recipient);
+    if (window == NULL) {
+        return;
+    } else {
+        win_vprint_line(window, '!', 0, "SMP session started.");
+        win_update_virtual(window);
+    }
+}
+
+static void
+_ui_smp_unsuccessful_sender(const char * const recipient)
+{
+    ProfWin *window = wins_get_by_recipient(recipient);
+    if (window == NULL) {
+        return;
+    } else {
+        win_vprint_line(window, '!', 0, "SMP session failed, the secret you entered does not match the secret entered by %s.", recipient);
+        win_update_virtual(window);
+    }
+}
+
+static void
+_ui_smp_successful_receiver(const char * const recipient)
+{
+    ProfWin *window = wins_get_by_recipient(recipient);
+    if (window == NULL) {
+        return;
+    } else {
+        win_vprint_line(window, '!', 0, "SMP session started.");
+        win_update_virtual(window);
+    }
+}
+
+static void
+_ui_smp_unsuccessful_receiver(const char * const recipient)
+{
+    ProfWin *window = wins_get_by_recipient(recipient);
+    if (window == NULL) {
+        return;
+    } else {
+        win_vprint_line(window, '!', 0, "SMP session failed, the secret %s entered does not match the secret you entered.", recipient);
+        win_update_virtual(window);
+    }
+}
+
+static void
+_ui_smp_aborted(const char * const recipient)
+{
+    ProfWin *window = wins_get_by_recipient(recipient);
+    if (window == NULL) {
+        return;
+    } else {
+        win_vprint_line(window, '!', 0, "SMP session aborted.");
+        win_update_virtual(window);
+    }
+}
+
+static void
 _ui_gone_insecure(const char * const recipient)
 {
     ProfWin *window = wins_get_by_recipient(recipient);
@@ -1978,6 +2050,12 @@ ui_init_module(void)
     ui_gone_insecure = _ui_gone_insecure;
     ui_trust = _ui_trust;
     ui_untrust = _ui_untrust;
+    ui_smp_recipient_initiated = _ui_smp_recipient_initiated;
+    ui_smp_successful_sender = _ui_smp_successful_sender;
+    ui_smp_unsuccessful_sender = _ui_smp_unsuccessful_sender;
+    ui_smp_successful_receiver = _ui_smp_successful_receiver;
+    ui_smp_unsuccessful_receiver = _ui_smp_unsuccessful_receiver;
+    ui_smp_aborted = _ui_smp_aborted;
     ui_chat_win_contact_online = _ui_chat_win_contact_online;
     ui_chat_win_contact_offline = _ui_chat_win_contact_offline;
     ui_handle_recipient_not_found = _ui_handle_recipient_not_found;