From 53d49f838d985c8a44142c036486d9328329d2d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sat, 1 Dec 2018 18:57:25 +0000 Subject: [PATCH] xep_0384: add bare_jid and device_id to NoAvailableSession exception MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We actually had the data all along! Signed-off-by: Maxime “pep” Buquet --- plugin.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugin.py b/plugin.py index 9b5b523..a67ff64 100644 --- a/plugin.py +++ b/plugin.py @@ -306,14 +306,12 @@ class XEP_0384(BasePlugin): payload, ) return body - except (omemo.exceptions.NoSessionException,) as e: + except (omemo.exceptions.NoSessionException,): # This might happen when the sender is sending using a session # that we don't know about (deleted session storage, etc.). In # this case we can't decrypt the message and it's going to be lost # in any case, but we want to tell the user, always. - # TODO: get ahold of bare_jid and device_id to pass in the - # exception. - raise NoAvailableSession + raise NoAvailableSession(jid, sid) finally: asyncio.ensure_future(self._publish_bundle())