summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0115
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-07-10 01:37:44 -0700
committerLance Stout <lancestout@gmail.com>2012-07-10 01:37:44 -0700
commite8a3e92ceb17d57ae95efd2a3fe7ed82c6ce2a2f (patch)
tree94429d10127c50478e656559a72d47539d12422c /sleekxmpp/plugins/xep_0115
parent5df3839b7a8b1a3ca47f057865a52fe7a3f30229 (diff)
downloadslixmpp-e8a3e92ceb17d57ae95efd2a3fe7ed82c6ce2a2f.tar.gz
slixmpp-e8a3e92ceb17d57ae95efd2a3fe7ed82c6ce2a2f.tar.bz2
slixmpp-e8a3e92ceb17d57ae95efd2a3fe7ed82c6ce2a2f.tar.xz
slixmpp-e8a3e92ceb17d57ae95efd2a3fe7ed82c6ce2a2f.zip
Update plugins to use session_bind handler for disco, and use plugin_end
Diffstat (limited to 'sleekxmpp/plugins/xep_0115')
-rw-r--r--sleekxmpp/plugins/xep_0115/caps.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/sleekxmpp/plugins/xep_0115/caps.py b/sleekxmpp/plugins/xep_0115/caps.py
index 9c93486b..8ce10edb 100644
--- a/sleekxmpp/plugins/xep_0115/caps.py
+++ b/sleekxmpp/plugins/xep_0115/caps.py
@@ -73,8 +73,6 @@ class XEP_0115(BasePlugin):
restart=False,
order=10010)
- self.xmpp['xep_0030'].add_feature(stanza.Capabilities.namespace)
-
disco = self.xmpp['xep_0030']
self.static = StaticCaps(self.xmpp, disco.static)
@@ -91,6 +89,19 @@ class XEP_0115(BasePlugin):
disco.assign_verstring = self.assign_verstring
disco.get_verstring = self.get_verstring
+ def plugin_end(self):
+ self.xmpp['xep_0030'].del_feature(feature=stanza.Capabilities.namespace)
+ self.xmpp.del_filter('out', self._filter_add_caps)
+ self.xmpp.del_event_handler('entity_caps', self._process_caps)
+ self.xmpp.remove_handler('Entity Capabilities')
+ if not self.xmpp.is_component:
+ self.xmpp.unregister_feature('caps', 10010)
+ for op in ('supports', 'has_identity'):
+ self.xmpp['xep_0030'].restore_defaults(op)
+
+ def session_bind(self, jid):
+ self.xmpp['xep_0030'].add_feature(stanza.Capabilities.namespace)
+
def _filter_add_caps(self, stanza):
if isinstance(stanza, Presence) and self.broadcast:
ver = self.get_verstring(stanza['from'])