From d6058156d95c759809e03ed9ab5f22cdae1841a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sun, 26 Dec 2021 19:31:09 +0100 Subject: [PATCH] Update for slixmpp-omemo update. API is now mostly async MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- poezio_omemo/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)