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:
Felix Van der Jeugt 2025-05-15 04:39:22 +02:00 committed by GitHub
parent 1dcd658928
commit 7dd09e32a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 109 additions and 1 deletions

View file

@ -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));