From 2f857047d30baa8cdcd667dddad37d382061df24 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Thu, 11 Jan 2007 19:58:51 +0000 Subject: [PATCH] check if connection is active before sending something. --- src/adhoc_commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adhoc_commands.py b/src/adhoc_commands.py index 49f51d8d7..84469cc29 100644 --- a/src/adhoc_commands.py +++ b/src/adhoc_commands.py @@ -487,7 +487,7 @@ class CommandWindow: def send_cancel(self): '''Send the command with action='cancel'. ''' assert self.commandnode is not None - if self.sessionid is not None: + if self.sessionid is not None and self.account.connection: # we already have sessionid, so the service sent at least one reply. stanza = xmpp.Iq(typ='set', to=self.jid) stanza.addChild('command', attrs={ @@ -496,7 +496,7 @@ class CommandWindow: 'sessionid':self.sessionid, 'action':'cancel' }) - + self.account.connection.send(stanza) else: # we did not received any reply from service; FIXME: we should wait and