xep_0384: handle OMEMO devices ns explicitely

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2018-12-29 07:40:01 +01:00
parent b64371e8fe
commit eb3916e92e

View file

@ -157,7 +157,8 @@ class XEP_0384(BasePlugin):
log.error("Couldn't load the OMEMO object; ¯\\_(ツ)_/¯") log.error("Couldn't load the OMEMO object; ¯\\_(ツ)_/¯")
raise PluginCouldNotLoad raise PluginCouldNotLoad
self.xmpp.add_event_handler('pubsub_publish', self._receive_device_list) self.xmpp['xep_0060'].map_node_event(OMEMO_DEVICES_NS, 'omemo_device_list')
self.xmpp.add_event_handler('omemo_device_list_publish', self._receive_device_list)
asyncio.ensure_future(self._set_device_list()) asyncio.ensure_future(self._set_device_list())
asyncio.ensure_future(self._publish_bundle()) asyncio.ensure_future(self._publish_bundle())
@ -165,7 +166,7 @@ class XEP_0384(BasePlugin):
if not self.backend_loaded: if not self.backend_loaded:
return return
self.xmpp.del_event_handler('pubsub_publish', self._receive_device_list) self.xmpp.remove_event_handler('omemo_device_list_publish', self._receive_device_list)
self.xmpp['xep_0163'].remove_interest(OMEMO_DEVICES_NS) self.xmpp['xep_0163'].remove_interest(OMEMO_DEVICES_NS)
def session_bind(self, _jid): def session_bind(self, _jid):