Update for slixmpp-omemo update. API is now mostly async
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
7243414aa0
commit
d6058156d9
1 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue