summaryrefslogtreecommitdiff
path: root/sleekxmpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-01-09 09:52:54 +0800
committerLance Stout <lancestout@gmail.com>2011-01-09 10:08:44 +0800
commit68ce47c9055f3ef485fe6810797032e7a5d8c370 (patch)
tree16eccc17fde059fe49cacdd569a1b20805e2421e /sleekxmpp
parent7c7fa0f00826f304dab12faad297ef339a7de2a0 (diff)
downloadslixmpp-68ce47c9055f3ef485fe6810797032e7a5d8c370.tar.gz
slixmpp-68ce47c9055f3ef485fe6810797032e7a5d8c370.tar.bz2
slixmpp-68ce47c9055f3ef485fe6810797032e7a5d8c370.tar.xz
slixmpp-68ce47c9055f3ef485fe6810797032e7a5d8c370.zip
Allow XEP 0092 to send os information
Doesn't send these information by default, only if provided in the config dict (as the 'os' key)
Diffstat (limited to 'sleekxmpp')
-rw-r--r--sleekxmpp/plugins/xep_0092.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/sleekxmpp/plugins/xep_0092.py b/sleekxmpp/plugins/xep_0092.py
index c9b418ff..8b5f8686 100644
--- a/sleekxmpp/plugins/xep_0092.py
+++ b/sleekxmpp/plugins/xep_0092.py
@@ -18,6 +18,7 @@ class xep_0092(base.base_plugin):
self.xep = "0092"
self.name = self.config.get('name', 'SleekXMPP')
self.version = self.config.get('version', '0.1-dev')
+ self.os = self.config.get('os', '')
self.xmpp.add_handler("<iq type='get' xmlns='%s'><query xmlns='jabber:iq:version' /></iq>" % self.xmpp.default_ns, self.report_version, name='Sofware Version')
def post_init(self):
@@ -32,6 +33,10 @@ class xep_0092(base.base_plugin):
name.text = self.name
version = ET.Element('version')
version.text = self.version
+ if self.os:
+ os = ET.Element('os')
+ os.text = self.os
+ query.append(os)
query.append(name)
query.append(version)
iq.append(query)