core (xmpp): isConnected now returns True when full connection is done:
isConnected was returning True as soon as transport was connected. It is now returning True only if full connection is done (i.e. transport is connected + all plugins have been initialised).
This commit is contained in:
parent
4c474efb3d
commit
f7360d31e2
1 changed files with 8 additions and 1 deletions
|
|
@ -466,11 +466,18 @@ class SatXMPPEntity:
|
|||
yield disconnected_cb(self)
|
||||
|
||||
def isConnected(self):
|
||||
"""Return True is client is fully connected
|
||||
|
||||
client is considered fully connected if transport is started and all plugins
|
||||
are initialised
|
||||
"""
|
||||
try:
|
||||
return bool(self.xmlstream.transport.connected)
|
||||
transport_connected = bool(self.xmlstream.transport.connected)
|
||||
except AttributeError:
|
||||
return False
|
||||
|
||||
return self._connected_d is not None and transport_connected
|
||||
|
||||
def entityDisconnect(self):
|
||||
if not self.host_app.trigger.point("disconnecting", self):
|
||||
return
|
||||
|
|
|
|||
Loading…
Reference in a new issue