diff --git a/slixmpp_omemo/__init__.py b/slixmpp_omemo/__init__.py index 2de37d0..6ebdeae 100644 --- a/slixmpp_omemo/__init__.py +++ b/slixmpp_omemo/__init__.py @@ -210,6 +210,7 @@ class XEP_0384(BasePlugin): log.error("Couldn't load the OMEMO object; ¯\\_(ツ)_/¯") raise PluginCouldNotLoad + self.xmpp.add_event_handler('session_start', self.session_start) 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) return None @@ -218,10 +219,11 @@ class XEP_0384(BasePlugin): if not self.backend_loaded: return + self.xmpp.remove_event_handler('session_start', self.session_start) self.xmpp.remove_event_handler('omemo_device_list_publish', self._receive_device_list) self.xmpp['xep_0163'].remove_interest(OMEMO_DEVICES_NS) - def session_bind(self, _jid): + def session_start(self, _jid): if self.backend_loaded: self.xmpp['xep_0163'].add_interest(OMEMO_DEVICES_NS) asyncio.ensure_future(self._set_device_list())