mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-16 03:55:42 -04:00
sdk: Allow to get rooms filtered by room state
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
committed by
Jonas Platte
parent
c978fa6d40
commit
eb5af4287f
@@ -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
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user