core (memory/encryption): automatic start encryption if peer send encrypted message:

If peer sends encrypted message and we have no encryption activated, we automatically
start encryption to avoid sending plain text message when answering.

markAsEncrypted now needs the encryption algorithm namespace as mandatory argument.
This commit is contained in:
Goffi 2020-03-23 17:52:18 +01:00
commit 2f8902e0d6

View file

@ -1162,7 +1162,7 @@ class OMEMO:
message_elt.children.remove(encrypted_elt)
if plaintext:
message_elt.addElement("body", content=plaintext)
post_treat.addCallback(client.encryption.markAsEncrypted)
post_treat.addCallback(client.encryption.markAsEncrypted, namespace=NS_OMEMO)
defer.returnValue(True)
def getJIDsForRoom(self, client, room_jid):