handle correctly clear and compact commands. Fixes #1882

This commit is contained in:
Yann Leboulanger 2006-04-21 19:54:47 +00:00
parent 01f8df63fd
commit 29784e622c
1 changed files with 8 additions and 2 deletions

View File

@ -405,11 +405,17 @@ class ChatControlBase(MessageControl):
if not message:
return False
if message == '/clear':
message = message[1:]
message_array = message.split(' ', 1)
command = message_array.pop(0).lower()
if message_array == ['']:
message_array = []
if command == 'clear' and not len(message_array):
self.conv_textview.clear() # clear conversation
self.clear(self.msg_textview) # clear message textview too
return True
elif message == '/compact':
elif message == 'compact' and not len(message_array):
self.chat_buttons_set_visible(not self.hide_chat_buttons_current)
self.clear(self.msg_textview)
return True