Restrict caps updates to available presences (not subscriptions, etc).
This commit is contained in:
parent
9047b627a4
commit
54656b331a
@ -104,12 +104,17 @@ class XEP_0115(BasePlugin):
|
|||||||
self.xmpp['xep_0030'].add_feature(stanza.Capabilities.namespace)
|
self.xmpp['xep_0030'].add_feature(stanza.Capabilities.namespace)
|
||||||
|
|
||||||
def _filter_add_caps(self, stanza):
|
def _filter_add_caps(self, stanza):
|
||||||
if isinstance(stanza, Presence) and self.broadcast:
|
if not isinstance(stanza, Presence) or not self.broadcast:
|
||||||
ver = self.get_verstring(stanza['from'])
|
return stanza
|
||||||
if ver:
|
|
||||||
stanza['caps']['node'] = self.caps_node
|
if stanza['type'] not in ('available', 'chat', 'away', 'dnd', 'xa'):
|
||||||
stanza['caps']['hash'] = self.hash
|
return stanza
|
||||||
stanza['caps']['ver'] = ver
|
|
||||||
|
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
|
return stanza
|
||||||
|
|
||||||
def _handle_caps(self, presence):
|
def _handle_caps(self, presence):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user