mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-04-23 00:27:39 -04:00
This patch updates `EventCacheInner::all_caches_for_rooms` by returning an `OwnedRwLockReadGuard` instead of `Caches`. `Caches` no longer implement `Clone`, which prevents cloning all the event caches per room when we need only one for example. `Caches` has two new methods: `handle_joined_room_update` and `handle_left_room_update`. This type acts more like a dispatcher now, which was the initial idea. That way, we don't need to dispatch manually on all event caches: `Caches` is responsible for that. We need to be a bit careful now since `all_caches_for_rooms` returns an owned read-lock over `EventCacheInner::by_room`.