mirror of
https://github.com/youwen5/iamb.git
synced 2025-06-20 05:39:52 -07:00
Support an "invite"
field in the room sorting settings (#395)
Co-authored-by: Felix Van der Jeugt <felix.vanderjeugt@posteo.net>
This commit is contained in:
parent
1dcd658928
commit
7dd09e32a8
4 changed files with 109 additions and 1 deletions
|
@ -243,6 +243,9 @@ pub enum SortFieldRoom {
|
|||
|
||||
/// Sort rooms by the timestamps of their most recent messages.
|
||||
Recent,
|
||||
|
||||
/// Sort rooms by whether they are invites.
|
||||
Invite,
|
||||
}
|
||||
|
||||
/// Fields that users can be sorted by.
|
||||
|
@ -307,6 +310,7 @@ impl<'de> Visitor<'de> for SortRoomVisitor {
|
|||
"name" => SortFieldRoom::Name,
|
||||
"alias" => SortFieldRoom::Alias,
|
||||
"id" => SortFieldRoom::RoomId,
|
||||
"invite" => SortFieldRoom::Invite,
|
||||
_ => {
|
||||
let msg = format!("Unknown sort field: {value:?}");
|
||||
return Err(E::custom(msg));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue