dont send just \n

This commit is contained in:
Nikos Kouremenos 2005-06-06 13:04:11 +00:00
parent 365c7f68ad
commit 2cc9a0aa5c
2 changed files with 7 additions and 7 deletions

View File

@ -338,13 +338,13 @@ class Groupchat_window(chat.Chat):
message_buffer = widget.get_buffer() message_buffer = widget.get_buffer()
start_iter = message_buffer.get_start_iter() start_iter = message_buffer.get_start_iter()
end_iter = message_buffer.get_end_iter() end_iter = message_buffer.get_end_iter()
txt = message_buffer.get_text(start_iter, end_iter, 0) message = message_buffer.get_text(start_iter, end_iter, 0)
if txt != '': if message != '' or message != '\n':
if txt == '/clear': if message == '/clear':
self.on_clear(None, conversation_textview) # clear conversation self.on_clear(None, conversation_textview) # clear conversation
self.on_clear(None, widget) # clear message textview too self.on_clear(None, widget) # clear message textview too
return True return True
gajim.connections[self.account].send_gc_message(room_jid, txt) gajim.connections[self.account].send_gc_message(room_jid, message)
message_buffer.set_text('', -1) message_buffer.set_text('', -1)
widget.grab_focus() widget.grab_focus()
return True return True

View File

@ -234,7 +234,7 @@ class Tabbed_chat_window(chat.Chat):
start_iter = message_buffer.get_start_iter() start_iter = message_buffer.get_start_iter()
end_iter = message_buffer.get_end_iter() end_iter = message_buffer.get_end_iter()
message = message_buffer.get_text(start_iter, end_iter, 0) message = message_buffer.get_text(start_iter, end_iter, 0)
if message != '': if message != '' or message != '\n':
if message == '/clear': if message == '/clear':
self.on_clear(None, conversation_textview) # clear conversation self.on_clear(None, conversation_textview) # clear conversation
self.on_clear(None, widget) # clear message textview too self.on_clear(None, widget) # clear message textview too