From 29852a931f667134e0100ee200494b8dcea53b2c Mon Sep 17 00:00:00 2001 From: Dimitur Kirov Date: Sat, 8 Apr 2006 16:40:43 +0000 Subject: [PATCH] don't try to send if connection is down (this check should be done in all functions that may come from user response to dialogs) --- src/common/connection_handlers.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index 4d0f41242..a60229cfc 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -208,6 +208,9 @@ class ConnectionBytestream: def send_file_rejection(self, file_props): ''' informs sender that we refuse to download the file ''' + # user response to ConfirmationDialog may come after we've disconneted + if not self.connection or self.connected < 2: + return iq = common.xmpp.Protocol(name = 'iq', to = unicode(file_props['sender']), typ = 'error') iq.setAttr('id', file_props['request-id']) @@ -218,6 +221,9 @@ class ConnectionBytestream: def send_file_approval(self, file_props): ''' send iq, confirming that we want to download the file ''' + # user response to ConfirmationDialog may come after we've disconneted + if not self.connection or self.connected < 2: + return iq = common.xmpp.Protocol(name = 'iq', to = unicode(file_props['sender']), typ = 'result') iq.setAttr('id', file_props['request-id'])