From 554248e10899635cec207820e2d6717174118b6a Mon Sep 17 00:00:00 2001 From: Goffi Date: Fri, 4 Jan 2019 18:46:39 +0100 Subject: [PATCH] plugin OTR: fixed a bug which was tagging every message as "encrypted" --- sat/plugins/plugin_sec_otr.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sat/plugins/plugin_sec_otr.py b/sat/plugins/plugin_sec_otr.py index ad0457c0..41103863 100644 --- a/sat/plugins/plugin_sec_otr.py +++ b/sat/plugins/plugin_sec_otr.py @@ -694,13 +694,14 @@ class OTR(object): raise failure.Failure( exceptions.CancelError("Cancelled by OTR") ) # no message at all (no history, no signal) - client.encryption.markAsEncrypted(data) - trusted = otrctx.isTrusted() - if trusted: - client.encryption.markAsTrusted(data) - else: - client.encryption.markAsUntrusted(data) + client.encryption.markAsEncrypted(data) + trusted = otrctx.isTrusted() + + if trusted: + client.encryption.markAsTrusted(data) + else: + client.encryption.markAsUntrusted(data) return data