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={
|
||||||
|
|
Loading…
Add table
Reference in a new issue