add constructor for spaces service

Also adds a public function to invalidate the cache rather than exposing
the entire cache publicly.
This commit is contained in:
Charles Hall 2024-10-08 16:31:57 -07:00
parent f702b6cccd
commit f771d319b2
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
4 changed files with 19 additions and 16 deletions

View file

@ -508,14 +508,12 @@ impl Service {
};
}
TimelineEventType::SpaceChild => {
if let Some(_state_key) = &pdu.state_key {
if pdu.state_key.is_some() {
services()
.rooms
.spaces
.roomid_spacechunk_cache
.lock()
.await
.remove(&pdu.room_id);
.invalidate_cache(&pdu.room_id)
.await;
}
}
TimelineEventType::RoomMember => {