diff --git a/examples/echo_client.py b/examples/echo_client.py index c8d188c..f5fc2ee 100644 --- a/examples/echo_client.py +++ b/examples/echo_client.py @@ -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