Make session_start handler async and use asyncio helper in it
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
0e65c68371
commit
869b11d322
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue