From a51c63ae355172c3b29c20361ee26a5cf7fd1a10 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 21 Jun 2005 20:04:23 +0000 Subject: [PATCH] don't send empty messages --- src/common/connection.py | 2 ++ src/groupchat_window.py | 2 ++ src/tabbed_chat_window.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/common/connection.py b/src/common/connection.py index e3e058755..61c92f859 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -795,6 +795,8 @@ class Connection: def send_message(self, jid, msg, keyID): if not self.connection: return + if not msg: + return msgtxt = msg msgenc = '' if keyID and USE_GPG: diff --git a/src/groupchat_window.py b/src/groupchat_window.py index 4770660b1..686cd0821 100644 --- a/src/groupchat_window.py +++ b/src/groupchat_window.py @@ -495,6 +495,8 @@ class GroupchatWindow(chat.Chat): def send_gc_message(self, message): '''call this function to send our message''' + if not message: + return room_jid = self.get_active_jid() message_textview = self.xmls[room_jid].get_widget( 'message_textview') diff --git a/src/tabbed_chat_window.py b/src/tabbed_chat_window.py index 8844e3257..46f0990d5 100644 --- a/src/tabbed_chat_window.py +++ b/src/tabbed_chat_window.py @@ -304,6 +304,8 @@ class TabbedChatWindow(chat.Chat): def send_message(self, message): """Send the message given in the args""" + if not message: + return jid = self.get_active_jid() conversation_textview = self.xmls[jid].get_widget('conversation_textview') message_textview = self.xmls[jid].get_widget('message_textview')