about summary refs log tree commit diff stats
path: root/src/omemo
diff options
context:
space:
mode:
authorPaul Fariello <paul@fariello.eu>2019-03-14 08:34:22 +0100
committerPaul Fariello <paul@fariello.eu>2019-04-10 17:12:31 +0200
commit8952684472eac14967134279bcc39cbff7f55a7b (patch)
tree4bd12417f90a0a2210d59e17607c9152611a66d2 /src/omemo
parent2455bcc28a5988235dff6fccc6a4fb494db936a2 (diff)
downloadprofani-tty-8952684472eac14967134279bcc39cbff7f55a7b.tar.gz
Add hints about trust command when printing fingerprints
Diffstat (limited to 'src/omemo')
-rw-r--r--src/omemo/omemo.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/omemo/omemo.c b/src/omemo/omemo.c
index f360232f..b8307352 100644
--- a/src/omemo/omemo.c
+++ b/src/omemo/omemo.c
@@ -438,7 +438,12 @@ omemo_start_device_session(const char *const jid, uint32_t device_id,
     if (g_strcmp0(jid, ownjid->barejid) == 0) {
         char *fingerprint = omemo_fingerprint(identity_key, TRUE);
 
-        cons_show("Available device identity: %s%s", fingerprint, trusted ? " (trusted)" : "");
+        cons_show("Available device identity for %s: %s%s", ownjid->barejid, fingerprint, trusted ? " (trusted)" : "");
+        if (trusted) {
+            cons_show("You can untrust it with '/omemo untrust %s <fingerprint>'", ownjid->barejid);
+        } else {
+            cons_show("You can trust it with '/omemo trust %s <fingerprint>'", ownjid->barejid);
+        }
         free(fingerprint);
     }
 
@@ -447,6 +452,11 @@ omemo_start_device_session(const char *const jid, uint32_t device_id,
         char *fingerprint = omemo_fingerprint(identity_key, TRUE);
 
         win_println((ProfWin *)chatwin, THEME_DEFAULT, '-', "Available device identity: %s%s", fingerprint, trusted ? " (trusted)" : "");
+        if (trusted) {
+            win_println((ProfWin *)chatwin, THEME_DEFAULT, '-', "You can untrust it with '/omemo untrust <fingerprint>'");
+        } else {
+            win_println((ProfWin *)chatwin, THEME_DEFAULT, '-', "You can trust it with '/omemo trust <fingerprint>'");
+        }
         free(fingerprint);
     }