diff sat/core/xmpp.py @ 3228:cc3fea71c365

core (memory/encryption): set encrypted flag also for outgoing messages and put it in extra: - `encrypted` flag is now put directly in extra, so that there is nothing to change when sending the message to bridge for frontends to be aware of it. - this flag is now also set when markAsEncrypted is used, so frontend can display appropriate indicator to show that outgoing message is encrypted or not.
author Goffi <goffi@goffi.org>
date Mon, 23 Mar 2020 16:53:03 +0100
parents 2f406b762788
children 199fc4c551e9
line wrap: on
line diff
--- a/sat/core/xmpp.py	Sun Mar 22 18:47:59 2020 +0100
+++ b/sat/core/xmpp.py	Mon Mar 23 16:53:03 2020 +0100
@@ -1183,8 +1183,8 @@
             data["extra"]["delay_sender"] = data["delay_sender"]
         except KeyError:
             pass
-        if C.MESS_KEY_ENCRYPTION in data:
-            data["extra"]["encrypted"] = C.BOOL_TRUE
+        if self.client.encryption.isEncrypted(data):
+            data["extra"]["encrypted"] = True
         if data is not None:
             if self.parent.isMessagePrintable(data):
                 self.host.bridge.messageNew(