Fix waiting rooms being sorted to bottom
This commit is contained in:
parent
1e90e76fba
commit
4e2b597f1e
2 changed files with 4 additions and 4 deletions
|
|
@ -25,6 +25,7 @@ Procedure when bumping the version number:
|
|||
- Display colon-delimited emoji in nicks and messages
|
||||
- Non-export info is now printed to stderr instead of stdout
|
||||
- Recognizes links without scheme (e. g. `euphoria.io` instead of `https://euphoria.io`)
|
||||
- Rooms waiting for reconnect are no longer sorted to bottom in default sort order
|
||||
|
||||
### Fixed
|
||||
- Mentions not being stopped by `>`
|
||||
|
|
|
|||
|
|
@ -317,10 +317,9 @@ impl Rooms {
|
|||
|
||||
fn sort_rooms(&self, rooms: &mut [(&String, Option<&euph::State>, usize)]) {
|
||||
match self.order {
|
||||
Order::Alphabet => rooms.sort_unstable_by_key(|(n, _, _)| *n),
|
||||
Order::Importance => rooms.sort_unstable_by_key(|(n, s, u)| {
|
||||
let no_instance = matches!(s, None | Some(euph::State::Disconnected));
|
||||
(no_instance, *u == 0, *n)
|
||||
Order::Alphabet => rooms.sort_unstable_by_key(|(name, _, _)| *name),
|
||||
Order::Importance => rooms.sort_unstable_by_key(|(name, state, unseen)| {
|
||||
(state.is_none(), *unseen == 0, *name)
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue