Commit 8dbfc140 authored by Maxime Buquet's avatar Maxime Buquet

xep_0384: do things in session_bind only if lib is available

`session_bind` is apparently loaded at about the same time as
plugin_init, and exceptions will be raise if the library could not be
loaded.
Signed-off-by: Maxime Buquet's avatarMaxime “pep” Buquet <pep@bouah.net>
parent 3a7711aa
......@@ -144,7 +144,7 @@ class XEP_0384(BasePlugin):
if not self.backend_loaded:
log.info("xep_0384 cannot be loaded as the backend omemo library "
"is not available")
return None
raise PluginCouldNotLoad
if not self.data_dir:
log.info("xep_0384 canoot be loaded as there is not data directory "
......@@ -183,9 +183,10 @@ class XEP_0384(BasePlugin):
self.xmpp['xep_0163'].remove_interest(OMEMO_DEVICES_NS)
def session_bind(self, _jid):
self.xmpp['xep_0163'].add_interest(OMEMO_DEVICES_NS)
asyncio.ensure_future(self._set_device_list())
asyncio.ensure_future(self._publish_bundle())
if self.backend_loaded:
self.xmpp['xep_0163'].add_interest(OMEMO_DEVICES_NS)
asyncio.ensure_future(self._set_device_list())
asyncio.ensure_future(self._publish_bundle())
def my_device_id(self) -> int:
return self._device_id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment