summaryrefslogtreecommitdiff
path: root/src/tabs.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-07-11 20:55:05 +0200
committerFlorent Le Coz <louiz@louiz.org>2011-07-11 20:55:05 +0200
commit8084e5cd368a7e3f86bc5d9947a1ffbc285be175 (patch)
treeed2cf8cfaf131995122879d2c892258423647047 /src/tabs.py
parent956bda066b683001b23f718bd5892440d03b5401 (diff)
downloadpoezio-8084e5cd368a7e3f86bc5d9947a1ffbc285be175.tar.gz
poezio-8084e5cd368a7e3f86bc5d9947a1ffbc285be175.tar.bz2
poezio-8084e5cd368a7e3f86bc5d9947a1ffbc285be175.tar.xz
poezio-8084e5cd368a7e3f86bc5d9947a1ffbc285be175.zip
/version doesn’t block anymore waiting for the answer.
Diffstat (limited to 'src/tabs.py')
-rw-r--r--src/tabs.py18
1 files changed, 10 insertions, 8 deletions
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 <jid or nick>
"""
+ 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):
"""