summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--slixmpp/plugins/xep_0092/version.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/slixmpp/plugins/xep_0092/version.py b/slixmpp/plugins/xep_0092/version.py
index 839f740d..35c2c5ce 100644
--- a/slixmpp/plugins/xep_0092/version.py
+++ b/slixmpp/plugins/xep_0092/version.py
@@ -65,9 +65,14 @@ class XEP_0092(BasePlugin):
iq -- The Iq stanza containing the software version query.
"""
iq = iq.reply()
- iq['software_version']['name'] = self.software_name
- iq['software_version']['version'] = self.version
- iq['software_version']['os'] = self.os
+ if self.software_name:
+ iq['software_version']['name'] = self.software_name
+ iq['software_version']['version'] = self.version
+ iq['software_version']['os'] = self.os
+ else:
+ iq.error()
+ iq['error']['type'] = 'cancel'
+ iq['error']['condition'] = 'forbidden'
iq.send()
def get_version(self, jid, ifrom=None, timeout=None, callback=None,