sdk: Allow to get rooms filtered by room state

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
Kévin Commaille
2023-06-09 10:27:43 +02:00
committed by Jonas Platte
parent c978fa6d40
commit eb5af4287f
2 changed files with 10 additions and 0 deletions

View File

@@ -14,6 +14,7 @@
for invited rooms too.
- Add `Client::subscribe_to_room_updates` and `room::Common::subscribe_to_updates`
- `Client::rooms` now returns all rooms, even invited, as advertised.
- Add `Client::rooms_filtered`
# 0.6.2

View File

@@ -887,6 +887,15 @@ impl Client {
.collect()
}
/// Get all the rooms the client knows about, filtered by room state.
pub fn rooms_filtered(&self, filter: RoomStateFilter) -> Vec<room::Room> {
self.base_client()
.get_rooms_filtered(filter)
.into_iter()
.map(|room| room::Common::new(self.clone(), room).into())
.collect()
}
/// Returns the joined rooms this client knows about.
pub fn joined_rooms(&self) -> Vec<room::Joined> {
self.base_client()