summaryrefslogtreecommitdiff
path: root/src/core.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-03-15 23:40:54 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-03-15 23:40:54 +0100
commit6e14fce61f12dc35d0f0a88f12f1cbf58fd58d7a (patch)
treefd3b6767c07bf39a0a6965a9f0af5d360eafafb9 /src/core.py
parente06b8baa525e64327f4c694d4e7a4bba4e308718 (diff)
downloadpoezio-6e14fce61f12dc35d0f0a88f12f1cbf58fd58d7a.tar.gz
poezio-6e14fce61f12dc35d0f0a88f12f1cbf58fd58d7a.tar.bz2
poezio-6e14fce61f12dc35d0f0a88f12f1cbf58fd58d7a.tar.xz
poezio-6e14fce61f12dc35d0f0a88f12f1cbf58fd58d7a.zip
/version <jid> command
Diffstat (limited to 'src/core.py')
-rw-r--r--src/core.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core.py b/src/core.py
index 129b6e92..031c4127 100644
--- a/src/core.py
+++ b/src/core.py
@@ -119,6 +119,7 @@ class Core(object):
'theme': (self.command_theme, _('Usage: /theme\nTheme: Reload the theme defined in the config file.'), None),
'list': (self.command_list, _('Usage: /list\nList: get the list of public chatrooms on the specified server'), self.completion_list),
'message': (self.command_message, _('Usage: /message <jid> [optional message]\nMessage: Open a conversation with the specified JID (even if it is not in our roster), and send a message to it, if specified'), None),
+ 'version': (self.command_version, _('Usage: /version <jid>\nVersion: get the software version of the given JID (usually its XMPP client and Operating System)'), None),
}
self.key_func = {
@@ -952,6 +953,23 @@ class Core(object):
if len(args) > 1:
tab.command_say(arg.strip()[len(jid):])
+ def command_version(self, arg):
+ """
+ /version <jid>
+ """
+ args = arg.split()
+ 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,))
+ 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)
+
def command_list(self, arg):
"""
/list <server>