check if connection is active before sending something.
This commit is contained in:
parent
99f8a9cbb9
commit
2f857047d3
1 changed files with 2 additions and 2 deletions
|
@ -487,7 +487,7 @@ class CommandWindow:
|
||||||
def send_cancel(self):
|
def send_cancel(self):
|
||||||
'''Send the command with action='cancel'. '''
|
'''Send the command with action='cancel'. '''
|
||||||
assert self.commandnode is not None
|
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.
|
# we already have sessionid, so the service sent at least one reply.
|
||||||
stanza = xmpp.Iq(typ='set', to=self.jid)
|
stanza = xmpp.Iq(typ='set', to=self.jid)
|
||||||
stanza.addChild('command', attrs={
|
stanza.addChild('command', attrs={
|
||||||
|
@ -496,7 +496,7 @@ class CommandWindow:
|
||||||
'sessionid':self.sessionid,
|
'sessionid':self.sessionid,
|
||||||
'action':'cancel'
|
'action':'cancel'
|
||||||
})
|
})
|
||||||
|
|
||||||
self.account.connection.send(stanza)
|
self.account.connection.send(stanza)
|
||||||
else:
|
else:
|
||||||
# we did not received any reply from service; FIXME: we should wait and
|
# we did not received any reply from service; FIXME: we should wait and
|
||||||
|
|
Loading…
Add table
Reference in a new issue