Move stability checks back into room

This commit is contained in:
Joscha 2022-08-21 02:38:45 +02:00
parent 878467835e
commit 235fd9acc5
3 changed files with 15 additions and 22 deletions

View file

@ -153,8 +153,20 @@ impl EuphRoom {
fn stabilize_state(&mut self, status: &RoomStatus) {
match &self.state {
State::Auth(_) if !auth::stable(status) => self.state = State::Normal,
State::Nick(_) if !nick::stable(status) => self.state = State::Normal,
State::Auth(_)
if !matches!(
status,
RoomStatus::Connected(Status::Joining(Joining {
bounce: Some(_),
..
}))
) =>
{
self.state = State::Normal
}
State::Nick(_) if !matches!(status, RoomStatus::Connected(Status::Joined(_))) => {
self.state = State::Normal
}
_ => {}
}
}