use RoomTypeFilter instead of Option<RoomType>

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
morguldir 2024-09-07 12:19:59 -04:00 committed by strawberry
parent b003338b90
commit b432789838

View File

@ -12,8 +12,9 @@ use ruma_common::{
api::{request, response, Metadata}, api::{request, response, Metadata},
directory::RoomTypeFilter, directory::RoomTypeFilter,
metadata, metadata,
room::RoomType,
serde::{deserialize_cow_str, duration::opt_ms, Raw}, serde::{deserialize_cow_str, duration::opt_ms, Raw},
DeviceKeyAlgorithm, MilliSecondsSinceUnixEpoch, OwnedMxcUri, OwnedRoomId, OwnedUserId, RoomId, room::RoomType DeviceKeyAlgorithm, MilliSecondsSinceUnixEpoch, OwnedMxcUri, OwnedRoomId, OwnedUserId, RoomId,
}; };
use ruma_events::{ use ruma_events::{
receipt::SyncReceiptEvent, typing::SyncTypingEvent, AnyGlobalAccountDataEvent, receipt::SyncReceiptEvent, typing::SyncTypingEvent, AnyGlobalAccountDataEvent,
@ -231,14 +232,14 @@ pub struct SyncRequestListFilters {
/// returned regardless of type. This can be used to get the initial set of spaces for an /// returned regardless of type. This can be used to get the initial set of spaces for an
/// account. /// account.
#[serde(default, skip_serializing_if = "Vec::is_empty")] #[serde(default, skip_serializing_if = "Vec::is_empty")]
pub room_types: Vec<Option<RoomType>>, pub room_types: Vec<RoomTypeFilter>,
/// Only list rooms that are not of these create-types, or all. /// Only list rooms that are not of these create-types, or all.
/// ///
/// Same as "room_types" but inverted. This can be used to filter out spaces from the room /// Same as "room_types" but inverted. This can be used to filter out spaces from the room
/// list. /// list.
#[serde(default, skip_serializing_if = "<[_]>::is_empty")] #[serde(default, skip_serializing_if = "<[_]>::is_empty")]
pub not_room_types: Vec<Option<RoomType>>, pub not_room_types: Vec<RoomTypeFilter>,
/// Only list rooms matching the given string, or all. /// Only list rooms matching the given string, or all.
/// ///