xep_0092: Send a <forbidden/> error if we don’t want to send our version. (thanks lovetox!)
This commit is contained in:
parent
20107ad516
commit
37d1f2a6b0
1 changed files with 8 additions and 3 deletions
|
@ -65,9 +65,14 @@ class XEP_0092(BasePlugin):
|
||||||
iq -- The Iq stanza containing the software version query.
|
iq -- The Iq stanza containing the software version query.
|
||||||
"""
|
"""
|
||||||
iq = iq.reply()
|
iq = iq.reply()
|
||||||
|
if self.software_name:
|
||||||
iq['software_version']['name'] = self.software_name
|
iq['software_version']['name'] = self.software_name
|
||||||
iq['software_version']['version'] = self.version
|
iq['software_version']['version'] = self.version
|
||||||
iq['software_version']['os'] = self.os
|
iq['software_version']['os'] = self.os
|
||||||
|
else:
|
||||||
|
iq.error()
|
||||||
|
iq['error']['type'] = 'cancel'
|
||||||
|
iq['error']['condition'] = 'forbidden'
|
||||||
iq.send()
|
iq.send()
|
||||||
|
|
||||||
def get_version(self, jid, ifrom=None, timeout=None, callback=None,
|
def get_version(self, jid, ifrom=None, timeout=None, callback=None,
|
||||||
|
|
Loading…
Reference in a new issue