summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0115
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-07-16 20:13:35 -0700
committerLance Stout <lancestout@gmail.com>2012-07-16 20:13:35 -0700
commit78f03253983779673beaf3c102ae315707a49d2c (patch)
treedd5c031b2fc96c88e3d03b7f21cb275ef937398c /sleekxmpp/plugins/xep_0115
parent1efe04995941933e7579efffd8f325d8c4b516ef (diff)
parentf6edaa56a6e91f7104cd63e5d48b39d4ca7e09f2 (diff)
downloadslixmpp-78f03253983779673beaf3c102ae315707a49d2c.tar.gz
slixmpp-78f03253983779673beaf3c102ae315707a49d2c.tar.bz2
slixmpp-78f03253983779673beaf3c102ae315707a49d2c.tar.xz
slixmpp-78f03253983779673beaf3c102ae315707a49d2c.zip
Merge branch 'master' into develop
Diffstat (limited to 'sleekxmpp/plugins/xep_0115')
-rw-r--r--sleekxmpp/plugins/xep_0115/caps.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/sleekxmpp/plugins/xep_0115/caps.py b/sleekxmpp/plugins/xep_0115/caps.py
index b0cba42d..8ce10edb 100644
--- a/sleekxmpp/plugins/xep_0115/caps.py
+++ b/sleekxmpp/plugins/xep_0115/caps.py
@@ -73,16 +73,15 @@ 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)
- self.api.settings['client_bare'] = False
- self.api.settings['component_bare'] = False
for op in self._disco_ops:
self.api.register(getattr(self.static, op), op, default=True)
+ for op in ('supports', 'has_identity'):
+ self.xmpp['xep_0030'].api.register(getattr(self.static, op), op)
+
self._run_node_handler = disco._run_node_handler
disco.cache_caps = self.cache_caps
@@ -90,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'])