diff --git a/poezio_omemo/__init__.py b/poezio_omemo/__init__.py index 4c828c2..5fb331f 100644 --- a/poezio_omemo/__init__.py +++ b/poezio_omemo/__init__.py @@ -116,7 +116,7 @@ class Plugin(E2EEPlugin): if trust is not None ] - def decrypt(self, message: Message, jid: Optional[JID], tab: ChatTab) -> None: + async def decrypt(self, message: Message, jid: Optional[JID], tab: ChatTab) -> None: if jid is None: self.display_error('Unable to decrypt the message.') return None @@ -133,7 +133,7 @@ class Plugin(E2EEPlugin): body = None try: encrypted = message['omemo_encrypted'] - body = self.core.xmpp['xep_0384'].decrypt_message( + body = await self.core.xmpp['xep_0384'].decrypt_message( encrypted, jid, # Always decrypt. Let us handle how we then warn the user. @@ -209,7 +209,7 @@ class Plugin(E2EEPlugin): # untrusted/undecided barejid, so we need to make a decision here. # This is where you prompt your user to ask what to do. In # this bot we will automatically trust undecided recipients. - self.core.xmpp['xep_0384'].trust(exn.bare_jid, exn.device, exn.ik) + await self.core.xmpp['xep_0384'].trust(exn.bare_jid, exn.device, exn.ik) # TODO: catch NoEligibleDevicesException except EncryptionPrepareException as exn: log.debug('FOO: EncryptionPrepareException: %r', exn.errors)