From bf9857b782586e4d17395a3feef0fd65aac428ee Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 6 Nov 2011 15:46:52 +0100 Subject: =?UTF-8?q?Fixes=20mostly=20#2285=20(no=20more=20crashes),=20but?= =?UTF-8?q?=20as=20for=20why=20we=20get=20an=20iqerror=20when=20trying=20t?= =?UTF-8?q?o=20get=20the=20version=20from=20a=20full=20jid=E2=80=A6?= =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/core.py') 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 """ + 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): """ -- cgit v1.2.3