Adapt example to new decrypt API

Signed-off-by: Maxime Buquet's avatarMaxime “pep” Buquet <pep@bouah.net>
parent 62b60376
......@@ -17,7 +17,7 @@ import logging
from getpass import getpass
from argparse import ArgumentParser
from slixmpp import ClientXMPP
from slixmpp import ClientXMPP, JID
from slixmpp.stanza import Message
from slixmpp_omemo import PluginCouldNotLoad, MissingOwnKey, EncryptionPrepareException
from slixmpp_omemo import UndecidedException, UntrustedException, NoAvailableSession
......@@ -84,7 +84,9 @@ class EchoBot(ClientXMPP):
return None
try:
body = self['xep_0384'].decrypt_message(msg, allow_untrusted)
mfrom = msg['from']
encrypted = msg['omemo_encrypted']
body = self['xep_0384'].decrypt_message(encrypted, mfrom, allow_untrusted)
await self.encrypted_reply(msg, 'Thanks for sending\n%s' % body.decode("utf8"))
except (MissingOwnKey,):
# The message is missing our own key, it was not encrypted for
......
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