summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-11-13 15:38:32 +0100
committermathieui <mathieui@mathieui.net>2011-11-13 15:38:32 +0100
commit9d575afbf8715a97bf03f488a356348bf9870069 (patch)
tree806c42da0d2ed800137913415f0a9a244b3ef22d
parent48679cb703da4a935dd72553e482795ceb87b181 (diff)
downloadpoezio-9d575afbf8715a97bf03f488a356348bf9870069.tar.gz
poezio-9d575afbf8715a97bf03f488a356348bf9870069.tar.bz2
poezio-9d575afbf8715a97bf03f488a356348bf9870069.tar.xz
poezio-9d575afbf8715a97bf03f488a356348bf9870069.zip
Completion for /message (re-uses the completion for /version)
-rw-r--r--src/core.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core.py b/src/core.py
index dfa8c490..c47a9751 100644
--- a/src/core.py
+++ b/src/core.py
@@ -125,7 +125,7 @@ class Core(object):
'set': (self.command_set, _("Usage: /set <option> [value]\nSet: Set the value of the option in your configuration file. You can, for example, change your default nickname by doing `/set default_nick toto` or your resource with `/set resource blabla`. You can also set an empty value (nothing) by providing no [value] after <option>."), self.completion_set),
'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.'), self.completion_theme),
'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 the message is specified.'), None),
+ '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 the message is specified.'), self.completion_version),
'version': (self.command_version, _('Usage: /version <jid>\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),
@@ -1441,6 +1441,9 @@ class Core(object):
def completion_version(self, the_input):
"""Completion for /version"""
+ n = len(the_input.get_text().split())
+ if n > 2 or (n == 2 and the_input.get_text().endswith(' ')):
+ return
return the_input.auto_completion([contact.bare_jid for contact in roster.get_contacts()], '')
def completion_list(self, the_input):