Fix auth failure popup not showing up
This commit is contained in:
parent
10ea7d13fd
commit
d25873f3c6
1 changed files with 15 additions and 0 deletions
|
|
@ -421,6 +421,21 @@ impl EuphRoom {
|
|||
// we'll get an `EuphRoomEvent::Disconnected` soon after this.
|
||||
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,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue