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

@ -84,7 +84,7 @@ class Tabbed_chat_window(chat.Chat):
self.xmls[jid].get_widget('gpg_togglebutton').set_sensitive(True) self.xmls[jid].get_widget('gpg_togglebutton').set_sensitive(True)
nontabbed_status_image = self.xmls[jid].get_widget( nontabbed_status_image = self.xmls[jid].get_widget(
'nontabbed_status_image') 'nontabbed_status_image')
if len(self.xmls) > 1: if len(self.xmls) > 1:
nontabbed_status_image.hide() nontabbed_status_image.hide()
else: else:
@ -107,7 +107,7 @@ class Tabbed_chat_window(chat.Chat):
state_images = self.plugin.roster.get_appropriate_state_images(jid) state_images = self.plugin.roster.get_appropriate_state_images(jid)
image = state_images[show] image = state_images[show]
non_tabbed_status_image = self.xmls[jid].get_widget( non_tabbed_status_image = self.xmls[jid].get_widget(
'nontabbed_status_image') 'nontabbed_status_image')
if keyID: if keyID:
self.xmls[jid].get_widget('gpg_togglebutton').set_sensitive(True) self.xmls[jid].get_widget('gpg_togglebutton').set_sensitive(True)
else: else:
@ -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