summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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):
"""