From 8084e5cd368a7e3f86bc5d9947a1ffbc285be175 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Mon, 11 Jul 2011 20:55:05 +0200 Subject: =?UTF-8?q?/version=20doesn=E2=80=99t=20block=20anymore=20waiting?= =?UTF-8?q?=20for=20the=20answer.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tabs.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/tabs.py b/src/tabs.py index 96a59621..0b68dcd9 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -482,6 +482,15 @@ class MucTab(ChatTab): """ /version """ + def callback(res): + if not res: + return self.core.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.core.information(version, 'Info') + args = common.shell_split(arg) if len(args) < 1: return @@ -489,14 +498,7 @@ class MucTab(ChatTab): jid = self._room.name + '/' + args[0] else: jid = args[0] - res = self.core.xmpp.plugin['xep_0092'].get_version(jid) - if not res: - return self.core.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.core.information(version, 'Info') + self.core.xmpp.plugin['xep_0092'].get_version(jid, callback=callback) def command_nick(self, arg): """ -- cgit v1.2.3