Change decrypt_message API. Don't take the entire message anymore

Signed-off-by: Maxime Buquet's avatarMaxime “pep” Buquet <pep@bouah.net>
parent 2b633526
......@@ -414,11 +414,16 @@ class XEP_0384(BasePlugin):
def is_encrypted(self, msg: Message) -> bool:
return msg.xml.find('{%s}encrypted' % OMEMO_BASE_NS) is not None
def decrypt_message(self, msg: Message, allow_untrusted: bool = False) -> Optional[str]:
header = msg['omemo_encrypted']['header']
payload = b64dec(msg['omemo_encrypted']['payload']['value'])
jid = msg['from'].bare
def decrypt_message(
self,
encrypted: Encrypted,
sender: JID,
allow_untrusted: bool = False,
) -> Optional[str]:
header = encrypted['header']
payload = b64dec(encrypted['payload']['value'])
jid = sender
sid = int(header['sid'])
key = header.xml.find("{%s}key[@rid='%s']" % (
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment