From 83e52d55f2e4fb544ebf7d9463d3a4b325923a6b Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Tue, 15 Feb 2011 16:22:25 +0100 Subject: [PATCH] /message command. Fixed #2106 --- src/core.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/core.py b/src/core.py index f7a7dc4d..9103e04f 100644 --- a/src/core.py +++ b/src/core.py @@ -131,6 +131,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\n/List: get the list of public chatrooms on the specified server'), self.completion_list), 'status': (self.command_status, _('Usage: /status [status message]\n/Status: Globally change your status and your status message.'), self.completion_status), + 'message': (self.command_message, _('Usage: /message [optional message]\n/Message: Open a conversation with the specified JID (even if it is not in our roster), and send a message to it, if specified'), None), } self.key_func = { @@ -1014,6 +1015,19 @@ class Core(object): def completion_status(self, the_input): return the_input.auto_completion([status for status in list(possible_show.keys())], ' ') + def command_message(self, arg): + """ + /message [message] + """ + args = arg.split() + if len(args) < 1: + self.command_help('message') + return + jid = args[0] + tab = self.open_conversation_window(jid, focus=True) + if len(args) > 1: + tab.command_say(arg.strip()[len(jid):]) + def command_list(self, arg): """ /list