From 98c342c1d4407d9e630e6bc5b4e5a24e6c4ac42d Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 13 Nov 2011 14:34:45 +0100 Subject: Completion for /version --- src/core.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core.py b/src/core.py index 751b21f1..330d3d73 100644 --- a/src/core.py +++ b/src/core.py @@ -126,7 +126,7 @@ class Core(object): 'theme': (self.command_theme, _('Usage: /theme [theme_name]\nTheme: Reload the theme defined in the config file. If theme_name is provided, set that theme before reloading it.'), 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 [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 the message is specified.'), None), - 'version': (self.command_version, _('Usage: /version \nVersion: Get the software version of the given JID (usually its XMPP client and Operating System).'), None), + 'version': (self.command_version, _('Usage: /version \nVersion: Get the software version of the given JID (usually its XMPP client and Operating System).'), self.completion_version), 'connect': (self.command_reconnect, _('Usage: /connect\nConnect: Disconnect from the remote server if you are currently connected and then connect to it again.'), None), 'server_cycle': (self.command_server_cycle, _('Usage: /server_cycle [domain] [message]\nServer Cycle: Disconnect and reconnect in all the rooms in domain.'), None), 'bind': (self.command_bind, _('Usage: /bind \nBind: Bind a key to an other key or to a “command”. For example "/bind ^H KEY_UP" makes Control + h do the same same as the Up key.'), None), @@ -1393,6 +1393,10 @@ class Core(object): the_input.auto_completion(serv_list, '') return True + def completion_version(self, the_input): + """Completion for /version""" + return the_input.auto_completion([contact.bare_jid for contact in roster.get_contacts()], '') + def completion_list(self, the_input): muc_serv_list = [] for tab in self.tabs: # TODO, also from an history -- cgit v1.2.3