xep_0384: Add clear_devices helper

This commit is contained in:
Maxime “pep” Buquet 2018-05-14 22:18:05 +01:00
parent 6f50f5dee7
commit 8b2348698e

View file

@ -114,6 +114,20 @@ class XEP_0384(BasePlugin):
iq = self._generate_bundle_iq()
await iq.send()
async def clear_device_list(self):
"""Clear devicelist for the account"""
self_id = Device()
self_id['id'] = str(self._device_id)
devices = Devices()
devices['devices'] = [self_id]
await self.xmpp['xep_0060'].publish(
self.xmpp.boundjid.bare,
OMEMO_DEVICES_NS,
payload=devices,
)
def _store_device_ids(self, jid, items):
self.device_ids[jid] = []
for item in items: