core (xmpp): don't purge entity on disconnect if continueTrying is set

This commit is contained in:
Goffi 2020-01-28 22:42:10 +01:00
commit b0dd28a346

View file

@ -374,15 +374,18 @@ class SatXMPPEntity(object):
self.host_app.bridge.disconnected(
self.profile
) # we send the signal to the clients
self._connected_d.callback(None)
self.host_app.purgeEntity(
self.profile
) # and we remove references to this client
log.info(
_("********** [{profile}] DISCONNECTED **********").format(
profile=self.profile
)
)
# we purge only if no new connection attempt is expected
if not self.factory.continueTrying:
log.debug("continueTrying not set, purging entity")
self._connected_d.callback(None)
# and we remove references to this client
self.host_app.purgeEntity(self.profile)
if not self.conn_deferred.called:
if reason is None:
err = error.StreamError("Server unexpectedly closed the connection")