diff options
author | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2010-08-05 22:37:55 +0000 |
---|---|---|
committer | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2010-08-05 22:37:55 +0000 |
commit | dc80a2288ef2cfed055d65b7797e9396c505c4a3 (patch) | |
tree | b93c593469725b0fec40d4a51f5402b6b269aa46 | |
parent | 58043c646db2bbbf5f65cb43c2d02254fdb82e60 (diff) | |
download | poezio-dc80a2288ef2cfed055d65b7797e9396c505c4a3.tar.gz poezio-dc80a2288ef2cfed055d65b7797e9396c505c4a3.tar.bz2 poezio-dc80a2288ef2cfed055d65b7797e9396c505c4a3.tar.xz poezio-dc80a2288ef2cfed055d65b7797e9396c505c4a3.zip |
command /say. fixed #1584
-rw-r--r-- | src/gui.py | 20 |
1 files changed, 17 insertions, 3 deletions
@@ -95,8 +95,8 @@ class Gui(object): 'topic': (self.command_topic, _("Usage: /topic <subject> \nTopic: Change the subject of the room")), 'link': (self.command_link, _("Usage: /link [option] [number]\nLink: Interact with a link in the conversation. Available options are 'open', 'copy'. Open just opens the link in the browser if it's http://, Copy just copy the link in the clipboard. An optional number can be provided, it indicates which link to interact with.")), 'query': (self.command_query, _('Usage: /query <nick> [message]\nQuery: Open a private conversation with <nick>. This nick has to be present in the room you\'re currently in. If you specified a message after the nickname, it will immediately be sent to this user')), - - 'nick': (self.command_nick, _("Usage: /nick <nickname> \nNick: Change your nickname in the current room")) + 'nick': (self.command_nick, _("Usage: /nick <nickname>\nNick: Change your nickname in the current room")), + 'say': (self.command_say, _('Usage: /say <message>\nSay: Just send the message. Useful if you want your message to begin with a "/"')), } self.key_func = { @@ -606,7 +606,7 @@ class Gui(object): return if line.startswith('/') and not line.startswith('/me '): command = line.strip()[:].split()[0][1:] - arg = line[1+len(command):] + arg = line[2+len(command):] # jump the '/' and the ' ' # example. on "/link 0 open", command = "link" and arg = "0 open" if command in self.commands.keys(): func = self.commands[command][0] @@ -686,6 +686,20 @@ class Gui(object): roomname = self.current_room().name self.muc.eject_user(roomname, 'kick', nick, reason) + def command_say(self, arg): + """ + /say <message> + """ + line = arg + if self.current_room().name != 'Info': + if self.current_room().jid is not None: + self.muc.send_private_message(self.current_room().name, line) + self.add_message_to_room(self.current_room(), line.decode('utf-8'), None, self.current_room().own_nick) + else: + self.muc.send_message(self.current_room().name, line) + self.window.input.refresh() + doupdate() + def command_join(self, arg): """ /join [room][/nick] [password] |