changeset 2753:3dd265d281e1

plugin OTR: fixed a bug which was tagging every message as "encrypted"
author Goffi <goffi@goffi.org>
date Fri, 04 Jan 2019 18:46:39 +0100
parents 1fa615faec8b
children 3bea6b5ae972
files sat/plugins/plugin_sec_otr.py
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/sat/plugins/plugin_sec_otr.py	Fri Jan 04 18:46:02 2019 +0100
+++ b/sat/plugins/plugin_sec_otr.py	Fri Jan 04 18:46:39 2019 +0100
@@ -694,13 +694,14 @@
                 raise failure.Failure(
                     exceptions.CancelError("Cancelled by OTR")
                 )  # no message at all (no history, no signal)
-        client.encryption.markAsEncrypted(data)
-        trusted = otrctx.isTrusted()
+
+            client.encryption.markAsEncrypted(data)
+            trusted = otrctx.isTrusted()
 
-        if trusted:
-            client.encryption.markAsTrusted(data)
-        else:
-            client.encryption.markAsUntrusted(data)
+            if trusted:
+                client.encryption.markAsTrusted(data)
+            else:
+                client.encryption.markAsUntrusted(data)
 
         return data