client-api: use RoomType for syncv3 filters instead of strings
(cherry picked from commit 5b2ce304010d7c4d1dc1b53af5d49eb1171422ed) Signed-off-by: morguldir <morguldir@protonmail.com>
This commit is contained in:
		
							parent
							
								
									642c981f99
								
							
						
					
					
						commit
						f1fbfb12ea
					
				@ -27,6 +27,9 @@ Improvements:
 | 
				
			|||||||
  to send `Future` events and update `Future` events with `future_tokens`.
 | 
					  to send `Future` events and update `Future` events with `future_tokens`.
 | 
				
			||||||
  (`Future` events are scheduled messages that can be controlled
 | 
					  (`Future` events are scheduled messages that can be controlled
 | 
				
			||||||
  with `future_tokens` to send on demand or restart the timeout)
 | 
					  with `future_tokens` to send on demand or restart the timeout)
 | 
				
			||||||
 | 
					- Change types of `SyncRequestListFilters::{room_types,not_room_types}` to
 | 
				
			||||||
 | 
					  `Vec<Option<RoomType>>` instead of a vector of strings
 | 
				
			||||||
 | 
					  - This is a breaking change, but only for users of `unstable-msc3575`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Bug fixes:
 | 
					Bug fixes:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -11,6 +11,7 @@ use js_option::JsOption;
 | 
				
			|||||||
use ruma_common::{
 | 
					use ruma_common::{
 | 
				
			||||||
    api::{request, response, Metadata},
 | 
					    api::{request, response, Metadata},
 | 
				
			||||||
    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,
 | 
					    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
 | 
					    /// 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<String>,
 | 
					    pub room_types: Vec<Option<RoomType>>,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /// 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<String>,
 | 
					    pub not_room_types: Vec<Option<RoomType>>,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /// Only list rooms matching the given string, or all.
 | 
					    /// Only list rooms matching the given string, or all.
 | 
				
			||||||
    ///
 | 
					    ///
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user