Make session_start handler async and use asyncio helper in it

Signed-off-by: Maxime Buquet's avatarMaxime “pep” Buquet <pep@bouah.net>
parent 0e65c683
......@@ -223,11 +223,13 @@ class XEP_0384(BasePlugin):
self.xmpp.remove_event_handler('omemo_device_list_publish', self._receive_device_list)
self.xmpp['xep_0163'].remove_interest(OMEMO_DEVICES_NS)
def session_start(self, _jid):
async def session_start(self, _jid):
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())
await asyncio.wait([
self._set_device_list(),
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