xep_0384: Rename list plugin_attrib to devices

This commit is contained in:
Maxime “pep” Buquet 2018-05-11 03:57:51 +02:00
parent 9100f9899b
commit dbd6b3ad3d
2 changed files with 5 additions and 5 deletions

View file

@ -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))

View file

@ -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)