From 2cc9a0aa5c7b24ae69a9c7744fb91ac89e5b5f9b Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Mon, 6 Jun 2005 13:04:11 +0000 Subject: [PATCH] dont send just \n --- src/groupchat_window.py | 8 ++++---- src/tabbed_chat_window.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/groupchat_window.py b/src/groupchat_window.py index 1d695b9be..9ee5ff110 100644 --- a/src/groupchat_window.py +++ b/src/groupchat_window.py @@ -338,13 +338,13 @@ class Groupchat_window(chat.Chat): message_buffer = widget.get_buffer() start_iter = message_buffer.get_start_iter() end_iter = message_buffer.get_end_iter() - txt = message_buffer.get_text(start_iter, end_iter, 0) - if txt != '': - if txt == '/clear': + message = message_buffer.get_text(start_iter, end_iter, 0) + if message != '' or message != '\n': + if message == '/clear': self.on_clear(None, conversation_textview) # clear conversation self.on_clear(None, widget) # clear message textview too 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) widget.grab_focus() return True diff --git a/src/tabbed_chat_window.py b/src/tabbed_chat_window.py index 7de867fa0..e9adfd1b0 100644 --- a/src/tabbed_chat_window.py +++ b/src/tabbed_chat_window.py @@ -84,7 +84,7 @@ class Tabbed_chat_window(chat.Chat): self.xmls[jid].get_widget('gpg_togglebutton').set_sensitive(True) nontabbed_status_image = self.xmls[jid].get_widget( - 'nontabbed_status_image') + 'nontabbed_status_image') if len(self.xmls) > 1: nontabbed_status_image.hide() else: @@ -107,7 +107,7 @@ class Tabbed_chat_window(chat.Chat): state_images = self.plugin.roster.get_appropriate_state_images(jid) image = state_images[show] non_tabbed_status_image = self.xmls[jid].get_widget( - 'nontabbed_status_image') + 'nontabbed_status_image') if keyID: self.xmls[jid].get_widget('gpg_togglebutton').set_sensitive(True) else: @@ -234,7 +234,7 @@ class Tabbed_chat_window(chat.Chat): start_iter = message_buffer.get_start_iter() end_iter = message_buffer.get_end_iter() message = message_buffer.get_text(start_iter, end_iter, 0) - if message != '': + if message != '' or message != '\n': if message == '/clear': self.on_clear(None, conversation_textview) # clear conversation self.on_clear(None, widget) # clear message textview too