Fix auth failure popup not showing up

This commit is contained in:
Joscha 2022-08-21 02:54:18 +02:00
parent 10ea7d13fd
commit d25873f3c6

View file

@ -421,6 +421,21 @@ impl EuphRoom {
// we'll get an `EuphRoomEvent::Disconnected` soon after this. // we'll get an `EuphRoomEvent::Disconnected` soon after this.
false false
} }
Data::AuthReply(reply) if !reply.success => {
// Because the euphoria API is very carefully designed with
// emphasis on consistency, authentication failures are not
// normal errors but instead error-free replies that encode
// their own error.
let description = "Failed to authenticate.".to_string();
let reason = reply
.reason
.unwrap_or_else(|| "no idea, the server wouldn't say".to_string());
self.popups.push_front(RoomPopup::ServerError {
description,
reason,
});
true
}
_ => true, _ => true,
} }
} }