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
|
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:
|
if jid is None:
|
||||||
self.display_error('Unable to decrypt the message.')
|
self.display_error('Unable to decrypt the message.')
|
||||||
return None
|
return None
|
||||||
|
@ -133,7 +133,7 @@ class Plugin(E2EEPlugin):
|
||||||
body = None
|
body = None
|
||||||
try:
|
try:
|
||||||
encrypted = message['omemo_encrypted']
|
encrypted = message['omemo_encrypted']
|
||||||
body = self.core.xmpp['xep_0384'].decrypt_message(
|
body = await self.core.xmpp['xep_0384'].decrypt_message(
|
||||||
encrypted,
|
encrypted,
|
||||||
jid,
|
jid,
|
||||||
# Always decrypt. Let us handle how we then warn the user.
|
# 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.
|
# 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 is where you prompt your user to ask what to do. In
|
||||||
# this bot we will automatically trust undecided recipients.
|
# 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
|
# TODO: catch NoEligibleDevicesException
|
||||||
except EncryptionPrepareException as exn:
|
except EncryptionPrepareException as exn:
|
||||||
log.debug('FOO: EncryptionPrepareException: %r', exn.errors)
|
log.debug('FOO: EncryptionPrepareException: %r', exn.errors)
|
||||||
|
|
Loading…
Reference in a new issue