diff --git a/crates/matrix-sdk/src/client/mod.rs b/crates/matrix-sdk/src/client/mod.rs index 948c323a2..938f3a853 100644 --- a/crates/matrix-sdk/src/client/mod.rs +++ b/crates/matrix-sdk/src/client/mod.rs @@ -1221,29 +1221,17 @@ impl Client { /// Returns the joined rooms this client knows about. pub fn joined_rooms(&self) -> Vec { - self.base_client() - .rooms_filtered(RoomStateFilter::JOINED) - .into_iter() - .map(|room| Room::new(self.clone(), room)) - .collect() + self.rooms_filtered(RoomStateFilter::JOINED) } /// Returns the invited rooms this client knows about. pub fn invited_rooms(&self) -> Vec { - self.base_client() - .rooms_filtered(RoomStateFilter::INVITED) - .into_iter() - .map(|room| Room::new(self.clone(), room)) - .collect() + self.rooms_filtered(RoomStateFilter::INVITED) } /// Returns the left rooms this client knows about. pub fn left_rooms(&self) -> Vec { - self.base_client() - .rooms_filtered(RoomStateFilter::LEFT) - .into_iter() - .map(|room| Room::new(self.clone(), room)) - .collect() + self.rooms_filtered(RoomStateFilter::LEFT) } /// Get a room with the given room id.