[misc] fix /say command in chat. Fixes #3284
This commit is contained in:
parent
0fb9d6dd56
commit
e53a47ebad
|
@ -896,7 +896,7 @@ class ChatControl(ChatControlBase):
|
||||||
'''A control for standard 1-1 chat'''
|
'''A control for standard 1-1 chat'''
|
||||||
TYPE_ID = message_control.TYPE_CHAT
|
TYPE_ID = message_control.TYPE_CHAT
|
||||||
old_msg_kind = None # last kind of the printed message
|
old_msg_kind = None # last kind of the printed message
|
||||||
CHAT_CMDS = ['clear', 'compact', 'help', 'me', 'ping']
|
CHAT_CMDS = ['clear', 'compact', 'help', 'me', 'ping', 'say']
|
||||||
|
|
||||||
def __init__(self, parent_win, contact, acct, resource = None):
|
def __init__(self, parent_win, contact, acct, resource = None):
|
||||||
ChatControlBase.__init__(self, self.TYPE_ID, parent_win,
|
ChatControlBase.__init__(self, self.TYPE_ID, parent_win,
|
||||||
|
@ -1206,6 +1206,8 @@ class ChatControl(ChatControlBase):
|
||||||
self.get_command_help(command)
|
self.get_command_help(command)
|
||||||
self.clear(self.msg_textview)
|
self.clear(self.msg_textview)
|
||||||
return True
|
return True
|
||||||
|
elif command == 'say':
|
||||||
|
return False
|
||||||
else:
|
else:
|
||||||
self.print_conversation(_('No such command: /%s (if you want to send '
|
self.print_conversation(_('No such command: /%s (if you want to send '
|
||||||
'this, prefix it with /say)') % command, 'info')
|
'this, prefix it with /say)') % command, 'info')
|
||||||
|
@ -1229,6 +1231,9 @@ class ChatControl(ChatControlBase):
|
||||||
elif command == 'ping':
|
elif command == 'ping':
|
||||||
self.print_conversation(_('Usage: /%s, sends a ping to the contact') %\
|
self.print_conversation(_('Usage: /%s, sends a ping to the contact') %\
|
||||||
command, 'info')
|
command, 'info')
|
||||||
|
elif command == 'say':
|
||||||
|
self.print_conversation(_('Usage: /%s, send the message to the contact') %\
|
||||||
|
command, 'info')
|
||||||
else:
|
else:
|
||||||
self.print_conversation(_('No help info for /%s') % command, 'info')
|
self.print_conversation(_('No help info for /%s') % command, 'info')
|
||||||
|
|
||||||
|
@ -1237,6 +1242,9 @@ class ChatControl(ChatControlBase):
|
||||||
if message in ('', None, '\n') or self._process_command(message):
|
if message in ('', None, '\n') or self._process_command(message):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if message.startswith('/say'):
|
||||||
|
message = message[5:]
|
||||||
|
|
||||||
# refresh timers
|
# refresh timers
|
||||||
self.reset_kbd_mouse_timeout_vars()
|
self.reset_kbd_mouse_timeout_vars()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue