From 37d1f2a6b09a4352c93913fa4c92153c4ca80cb4 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 8 Aug 2018 16:49:16 +0200 Subject: [PATCH] =?UTF-8?q?xep=5F0092:=20Send=20a=20=20error?= =?UTF-8?q?=20if=20we=20don=E2=80=99t=20want=20to=20send=20our=20version.?= =?UTF-8?q?=20(thanks=20lovetox!)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- slixmpp/plugins/xep_0092/version.py | 11 ++++++++--- 1 file 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,