summaryrefslogtreecommitdiff
path: root/src/core.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-11-06 15:46:52 +0100
committermathieui <mathieui@mathieui.net>2011-11-06 15:46:52 +0100
commitbf9857b782586e4d17395a3feef0fd65aac428ee (patch)
treebce50ba6e24760eb29d43c36510c196c53852b51 /src/core.py
parentfc20de76ffef3982e59bd004d1e7c9f3c6e0d4bc (diff)
downloadpoezio-bf9857b782586e4d17395a3feef0fd65aac428ee.tar.gz
poezio-bf9857b782586e4d17395a3feef0fd65aac428ee.tar.bz2
poezio-bf9857b782586e4d17395a3feef0fd65aac428ee.tar.xz
poezio-bf9857b782586e4d17395a3feef0fd65aac428ee.zip
Fixes mostly #2285 (no more crashes), but as for why we get an iqerror
when trying to get the version from a full jid……
Diffstat (limited to 'src/core.py')
-rw-r--r--src/core.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/core.py b/src/core.py
index 05ae2cb1..8c4ad258 100644
--- a/src/core.py
+++ b/src/core.py
@@ -1134,18 +1134,20 @@ class Core(object):
"""
/version <jid>
"""
+ def callback(res):
+ if not res:
+ return self.information('Could not get the software version from %s' % (jid,), 'Warning')
+ version = '%s is running %s version %s on %s' % (jid,
+ res.get('name') or _('an unknown software'),
+ res.get('version') or _('unknown'),
+ res.get('os') or _('on an unknown platform'))
+ self.information(version, 'Info')
+
args = common.shell_split(arg)
if len(args) < 1:
return self.command_help('version')
jid = args[0]
- res = self.xmpp.plugin['xep_0092'].get_version(jid)
- if not res:
- return self.information('Could not get the software version from %s' % (jid,), 'Warning')
- version = '%s is running %s version %s on %s' % (jid,
- res.get('name') or _('an unknown software'),
- res.get('version') or _('unknown'),
- res.get('os') or _('on an unknown platform'))
- self.information(version, 'Info')
+ self.xmpp.plugin['xep_0092'].get_version(jid, callback=callback)
def command_reconnect(self, args):
"""