From f1fbfb12ea320a9876a8122f3708a80184a6b406 Mon Sep 17 00:00:00 2001 From: morguldir Date: Fri, 23 Aug 2024 20:45:20 +0200 Subject: [PATCH] client-api: use RoomType for syncv3 filters instead of strings (cherry picked from commit 5b2ce304010d7c4d1dc1b53af5d49eb1171422ed) Signed-off-by: morguldir --- crates/ruma-client-api/CHANGELOG.md | 3 +++ crates/ruma-client-api/src/sync/sync_events/v4.rs | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/ruma-client-api/CHANGELOG.md b/crates/ruma-client-api/CHANGELOG.md index 3dc851b5..3a15d417 100644 --- a/crates/ruma-client-api/CHANGELOG.md +++ b/crates/ruma-client-api/CHANGELOG.md @@ -27,6 +27,9 @@ Improvements: to send `Future` events and update `Future` events with `future_tokens`. (`Future` events are scheduled messages that can be controlled with `future_tokens` to send on demand or restart the timeout) +- Change types of `SyncRequestListFilters::{room_types,not_room_types}` to + `Vec>` instead of a vector of strings + - This is a breaking change, but only for users of `unstable-msc3575` Bug fixes: diff --git a/crates/ruma-client-api/src/sync/sync_events/v4.rs b/crates/ruma-client-api/src/sync/sync_events/v4.rs index 2a6a56c6..3d88be78 100644 --- a/crates/ruma-client-api/src/sync/sync_events/v4.rs +++ b/crates/ruma-client-api/src/sync/sync_events/v4.rs @@ -11,6 +11,7 @@ use js_option::JsOption; use ruma_common::{ api::{request, response, Metadata}, metadata, + room::RoomType, serde::{deserialize_cow_str, duration::opt_ms, Raw}, DeviceKeyAlgorithm, MilliSecondsSinceUnixEpoch, OwnedMxcUri, OwnedRoomId, OwnedUserId, RoomId, }; @@ -230,14 +231,14 @@ pub struct SyncRequestListFilters { /// returned regardless of type. This can be used to get the initial set of spaces for an /// account. #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub room_types: Vec, + pub room_types: Vec>, /// 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 /// list. #[serde(default, skip_serializing_if = "<[_]>::is_empty")] - pub not_room_types: Vec, + pub not_room_types: Vec>, /// Only list rooms matching the given string, or all. ///