diff options
author | mathieui <mathieui@mathieui.net> | 2011-11-06 15:46:52 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2011-11-06 15:46:52 +0100 |
commit | bf9857b782586e4d17395a3feef0fd65aac428ee (patch) | |
tree | bce50ba6e24760eb29d43c36510c196c53852b51 /src/tabs.py | |
parent | fc20de76ffef3982e59bd004d1e7c9f3c6e0d4bc (diff) | |
download | poezio-bf9857b782586e4d17395a3feef0fd65aac428ee.tar.gz poezio-bf9857b782586e4d17395a3feef0fd65aac428ee.tar.bz2 poezio-bf9857b782586e4d17395a3feef0fd65aac428ee.tar.xz poezio-bf9857b782586e4d17395a3feef0fd65aac428ee.zip |
Fixes mostly #2285 (no more crashes), but as for why we get an iqerror
when trying to get the version from a full jid……
Diffstat (limited to 'src/tabs.py')
-rw-r--r-- | src/tabs.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tabs.py b/src/tabs.py index 43dcb2b9..b4d4ef44 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -1859,6 +1859,7 @@ class ConversationTab(ChatTab): # commands self.commands['unquery'] = (self.command_unquery, _("Usage: /unquery\nUnquery: close the tab"), None) self.commands['close'] = (self.command_unquery, _("Usage: /close\Close: close the tab"), None) + self.commands['version'] = (self.command_version, _('Usage: /version\nVersion: get the software version of the current interlocutor (usually its XMPP client and Operating System)'), None) self.resize() def completion(self): @@ -1885,6 +1886,21 @@ class ConversationTab(ChatTab): def command_unquery(self, arg): self.core.close_tab() + def command_version(self, arg): + """ + /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') + jid = self._name + self.core.xmpp.plugin['xep_0092'].get_version(jid, callback=callback) + def resize(self): if self.core.information_win_size >= self.height-3 or not self.visible: return |