From 9f837ededb13a66ff2507aa25e2e46c6f2959cbc Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Wed, 8 Mar 2006 12:29:34 +0000 Subject: [PATCH] check if we are conencted when we press send button. Fixes #1562 --- src/chat_control.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/chat_control.py b/src/chat_control.py index b263238cc..15f7d2f1c 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -144,6 +144,11 @@ class ChatControlBase(MessageControl): def _on_send_button_clicked(self, widget): '''When send button is pressed: send the current message''' + if gajim.connections[self.account].connected < 2: # we are not connected + dialog = dialogs.ErrorDialog(_('A connection is not available'), + _('Your message can not be sent until you are connected.')) + dialog.get_response() + return message_buffer = self.msg_textview.get_buffer() start_iter = message_buffer.get_start_iter() end_iter = message_buffer.get_end_iter()