summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-02-15 16:22:25 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-02-15 16:22:25 +0100
commit83e52d55f2e4fb544ebf7d9463d3a4b325923a6b (patch)
treea606352493f2d11e014d7f9d3aabd203fe8f01dd
parent68c468b1a97c3535ab06674ddbed2eaaf06de64d (diff)
downloadpoezio-83e52d55f2e4fb544ebf7d9463d3a4b325923a6b.tar.gz
poezio-83e52d55f2e4fb544ebf7d9463d3a4b325923a6b.tar.bz2
poezio-83e52d55f2e4fb544ebf7d9463d3a4b325923a6b.tar.xz
poezio-83e52d55f2e4fb544ebf7d9463d3a4b325923a6b.zip
/message command. Fixed #2106
-rw-r--r--src/core.py14
1 files changed, 14 insertions, 0 deletions
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 <availability> [status message]\n/Status: Globally change your status and your status message.'), self.completion_status),
+ 'message': (self.command_message, _('Usage: /message <jid> [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 <jid> [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 <server>