diff --git a/crates/matrix-sdk-base/src/store/mod.rs b/crates/matrix-sdk-base/src/store/mod.rs index 920c78995ef..f2784caa8d7 100644 --- a/crates/matrix-sdk-base/src/store/mod.rs +++ b/crates/matrix-sdk-base/src/store/mod.rs @@ -142,6 +142,7 @@ pub(crate) struct Store { session_meta: Arc>, /// The current sync token that should be used for the next sync call. pub(super) sync_token: Arc>>, + /// All rooms the store knows about. rooms: Arc>>, /// A lock to synchronize access to the store, such that data by the sync is /// never overwritten. @@ -203,7 +204,7 @@ impl Store { /// Get all the rooms this store knows about. pub fn get_rooms(&self) -> Vec { - self.rooms.read().unwrap().keys().filter_map(|id| self.get_room(id)).collect() + self.rooms.read().unwrap().values().cloned().collect() } /// Get all the rooms this store knows about, filtered by state.