# HG changeset patch # User Goffi # Date 1583515143 -3600 # Node ID fee8e33e2b3ff506948cfb7eec197052f4cf5ca4 # Parent 2e892f9f54f6aa47a1335a379c9c11de6b81995a 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). diff -r 2e892f9f54f6 -r fee8e33e2b3f sat/core/xmpp.py --- a/sat/core/xmpp.py Fri Mar 06 18:19:03 2020 +0100 +++ b/sat/core/xmpp.py Fri Mar 06 18:19:03 2020 +0100 @@ -466,11 +466,18 @@ 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