xep_0384: Add clear_devices helper
This commit is contained in:
parent
6f50f5dee7
commit
8b2348698e
1 changed files with 14 additions and 0 deletions
14
plugin.py
14
plugin.py
|
@ -114,6 +114,20 @@ class XEP_0384(BasePlugin):
|
||||||
iq = self._generate_bundle_iq()
|
iq = self._generate_bundle_iq()
|
||||||
await iq.send()
|
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):
|
def _store_device_ids(self, jid, items):
|
||||||
self.device_ids[jid] = []
|
self.device_ids[jid] = []
|
||||||
for item in items:
|
for item in items:
|
||||||
|
|
Loading…
Reference in a new issue