check if we have a connection before we send it sth

This commit is contained in:
Yann Leboulanger 2005-05-23 10:46:22 +00:00
parent 0f41e49758
commit 517211b63f

View file

@ -136,6 +136,8 @@ class Connection:
handler(self.name, data)
def _discover(self, ns, jid, node = None): #FIXME: this is in features.py but it is blocking
if not self.connection:
return
iq = common.xmpp.Iq(typ = 'get', to = jid, queryNS = ns)
if node:
iq.setQuerynode(node)
@ -966,6 +968,8 @@ class Connection:
traceback.print_exc()
self.connected = 0
self.dispatch('STATUS', 'offline')
if not self.connection:
return
try:
self.connection.disconnect()
except: