From dbd6b3ad3dadbfc6fa53ba88d85f342d6f537700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Fri, 11 May 2018 03:57:51 +0200 Subject: [PATCH] xep_0384: Rename list plugin_attrib to devices --- omemo.py | 2 +- stanza.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/omemo.py b/omemo.py index 0ea4931..99a58ab 100644 --- a/omemo.py +++ b/omemo.py @@ -47,7 +47,7 @@ class XEP_0384(BasePlugin): jid = JID(msg['from']).bare items = msg['pubsub_event']['items'] for item in items: - device_ids = [d['id'] for d in item['list']] + device_ids = [d['id'] for d in item['devices']] if jid not in self.device_ids: self.device_ids[jid] = device_ids self.xmpp.event('omemo_device_ids', (jid, device_ids)) diff --git a/stanza.py b/stanza.py index a67af1f..6bdd5e9 100644 --- a/stanza.py +++ b/stanza.py @@ -15,10 +15,10 @@ OMEMO_DEVICES_NS = OMEMO_BASE_NS + '.devicelist' OMEMO_BUNDLE_NS = OMEMO_BASE_NS + '.bundle' -class ItemList(ElementBase): +class Devices(ElementBase): namespace = OMEMO_BASE_NS name = 'list' - plugin_attrib = 'list' + plugin_attrib = 'devices' interfaces = set() @@ -34,5 +34,5 @@ class Device(ElementBase): return children[0] -register_stanza_plugin(EventItem, ItemList) -register_stanza_plugin(ItemList, Device, iterable=True) +register_stanza_plugin(EventItem, Devices) +register_stanza_plugin(Devices, Device, iterable=True)