diff --git a/sat/core/xmpp.py b/sat/core/xmpp.py index 26ce0935..dc0d8c47 100644 --- a/sat/core/xmpp.py +++ b/sat/core/xmpp.py @@ -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