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:
Goffi 2020-03-06 18:19:03 +01:00
commit f7360d31e2

View file

@ -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