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)