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:
parent
a6e4d1d33f
commit
2f8902e0d6
2 changed files with 20 additions and 5 deletions
|
|
@ -698,7 +698,7 @@ class OTR(object):
|
|||
exceptions.CancelError("Cancelled by OTR")
|
||||
) # no message at all (no history, no signal)
|
||||
|
||||
client.encryption.markAsEncrypted(data)
|
||||
client.encryption.markAsEncrypted(data, namespace=NS_OTR)
|
||||
trusted = otrctx.isTrusted()
|
||||
|
||||
if trusted:
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in a new issue