From 8b2348698ec05e6421eafe417eac193659570b4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Mon, 14 May 2018 22:18:05 +0100 Subject: [PATCH] xep_0384: Add clear_devices helper --- plugin.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plugin.py b/plugin.py index f4557d0..d8426ab 100644 --- a/plugin.py +++ b/plugin.py @@ -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: