xep_0384: _receive_device_list was never called because event system doesn't do async.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2019-01-29 18:10:10 +01:00
parent 9591cf0ced
commit 2a14807c02

View file

@ -239,9 +239,12 @@ class XEP_0384(BasePlugin):
device_ids = [int(d['id']) for d in items[0]['devices']] device_ids = [int(d['id']) for d in items[0]['devices']]
return self._omemo.newDeviceList(str(jid), device_ids) return self._omemo.newDeviceList(str(jid), device_ids)
async def _receive_device_list(self, msg: Message) -> None: def _receive_device_list(self, msg: Message) -> None:
"""Handler for received PEP OMEMO_DEVICES_NS payloads""" """Handler for received PEP OMEMO_DEVICES_NS payloads"""
return await self._read_device_list(msg['from'], msg['pubsub_event']['items']) asyncio.ensure_future(
self._read_device_list(msg['from'],
msg['pubsub_event']['items']),
)
async def _read_device_list(self, jid: JID, items: Union[Items, EventItems]) -> None: async def _read_device_list(self, jid: JID, items: Union[Items, EventItems]) -> None:
"""Read items and devices if we need to set the device list again or not""" """Read items and devices if we need to set the device list again or not"""