summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0115
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-07-30 09:08:58 -0700
committerLance Stout <lancestout@gmail.com>2012-07-30 09:08:58 -0700
commit44ce01a70b7926a1e1f4af6692be3bdc671f7318 (patch)
treec6992b7420f3731cea595b4d382c2d2987a7554a /sleekxmpp/plugins/xep_0115
parentc2189b4ecd6b022ed9900a6f411bd7e9d57c47ce (diff)
parente4b4c676379df30d268d28341b643cd9cd10eb22 (diff)
downloadslixmpp-44ce01a70b7926a1e1f4af6692be3bdc671f7318.tar.gz
slixmpp-44ce01a70b7926a1e1f4af6692be3bdc671f7318.tar.bz2
slixmpp-44ce01a70b7926a1e1f4af6692be3bdc671f7318.tar.xz
slixmpp-44ce01a70b7926a1e1f4af6692be3bdc671f7318.zip
Merge branch 'master' into develop
Diffstat (limited to 'sleekxmpp/plugins/xep_0115')
-rw-r--r--sleekxmpp/plugins/xep_0115/caps.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/sleekxmpp/plugins/xep_0115/caps.py b/sleekxmpp/plugins/xep_0115/caps.py
index 15ddb283..5130cc98 100644
--- a/sleekxmpp/plugins/xep_0115/caps.py
+++ b/sleekxmpp/plugins/xep_0115/caps.py
@@ -104,12 +104,17 @@ class XEP_0115(BasePlugin):
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'])
- if ver:
- stanza['caps']['node'] = self.caps_node
- stanza['caps']['hash'] = self.hash
- stanza['caps']['ver'] = ver
+ if not isinstance(stanza, Presence) or not self.broadcast:
+ return stanza
+
+ if stanza['type'] not in ('available', 'chat', 'away', 'dnd', 'xa'):
+ return stanza
+
+ ver = self.get_verstring(stanza['from'])
+ if ver:
+ stanza['caps']['node'] = self.caps_node
+ stanza['caps']['hash'] = self.hash
+ stanza['caps']['ver'] = ver
return stanza
def _handle_caps(self, presence):