Commit 5e45dc01 authored by Philipp Hörist's avatar Philipp Hörist

Fix regression from refactor

- When losing connection don't issue 'offline' event while we still can resume
with stream management

- Allow manual initated status change while reconnect is scheduled
parent bfa50806
Pipeline #4971 passed with stages
in 3 minutes and 5 seconds
......@@ -212,8 +212,8 @@ class CommonConnection:
if self._state.is_connecting or self._state.is_reconnect_scheduled:
if show == 'offline':
self.disconnect(reconnect=False)
else:
log.warning('Can\'t change status while connecting')
elif self._state.is_reconnect_scheduled:
self.reconnect()
return
# We are connected
......@@ -372,7 +372,7 @@ class Connection(CommonConnection, ConnectionHandlers):
def _set_reconnect_timer(self):
self._set_state(ClientState.RECONNECT_SCHEDULED)
app.nec.push_incoming_event(
OurShowEvent(None, conn=self, show='offline'))
OurShowEvent(None, conn=self, show='error'))
if app.status_before_autoaway[self.name]:
# We were auto away. So go back online
self._status_message = app.status_before_autoaway[self.name]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment