diff --git a/slixmpp_omemo/__init__.py b/slixmpp_omemo/__init__.py index f313ab2..fd0586c 100644 --- a/slixmpp_omemo/__init__.py +++ b/slixmpp_omemo/__init__.py @@ -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