diff --git a/slixmpp_omemo/__init__.py b/slixmpp_omemo/__init__.py index 2f901b3..1bf170b 100644 --- a/slixmpp_omemo/__init__.py +++ b/slixmpp_omemo/__init__.py @@ -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']) + def decrypt_message( + self, + encrypted: Encrypted, + sender: JID, + allow_untrusted: bool = False, + ) -> Optional[str]: + header = encrypted['header'] + payload = b64dec(encrypted['payload']['value']) - jid = msg['from'].bare + jid = sender sid = int(header['sid']) key = header.xml.find("{%s}key[@rid='%s']" % (