diff options
author | Sam Wedgwood <28223854+swedgwood@users.noreply.github.com> | 2023-07-20 15:06:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-20 15:06:05 +0100 |
commit | 958282749391a13dc6f03c1dd13a9554fb5db3ae (patch) | |
tree | 1f370ac9cf956667923756bf851b9329c2c67b98 /internal/caching/cache_space_rooms.go | |
parent | 297479ea4993f00a60600232485275d2c57462fe (diff) |
de-MSC-ifying space summaries (MSC2946) (#3134)helm-dendrite-0.13.1
- This PR moves and refactors the
[code](https://github.com/matrix-org/dendrite/blob/main/setup/mscs/msc2946/msc2946.go)
for
[MSC2946](https://github.com/matrix-org/matrix-spec-proposals/pull/2946)
('Space Summaries') to integrate it into the rest of the codebase.
- Means space summaries are no longer hidden behind an MSC flag
- Solves #3096
Signed-off-by: Sam Wedgwood <sam@wedgwood.dev>
Diffstat (limited to 'internal/caching/cache_space_rooms.go')
-rw-r--r-- | internal/caching/cache_space_rooms.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/internal/caching/cache_space_rooms.go b/internal/caching/cache_space_rooms.go index 100ab902..90eeb786 100644 --- a/internal/caching/cache_space_rooms.go +++ b/internal/caching/cache_space_rooms.go @@ -2,15 +2,16 @@ package caching import "github.com/matrix-org/gomatrixserverlib/fclient" -type SpaceSummaryRoomsCache interface { - GetSpaceSummary(roomID string) (r fclient.MSC2946SpacesResponse, ok bool) - StoreSpaceSummary(roomID string, r fclient.MSC2946SpacesResponse) +// RoomHierarchy cache caches responses to federated room hierarchy requests (A.K.A. 'space summaries') +type RoomHierarchyCache interface { + GetRoomHierarchy(roomID string) (r fclient.RoomHierarchyResponse, ok bool) + StoreRoomHierarchy(roomID string, r fclient.RoomHierarchyResponse) } -func (c Caches) GetSpaceSummary(roomID string) (r fclient.MSC2946SpacesResponse, ok bool) { - return c.SpaceSummaryRooms.Get(roomID) +func (c Caches) GetRoomHierarchy(roomID string) (r fclient.RoomHierarchyResponse, ok bool) { + return c.RoomHierarchies.Get(roomID) } -func (c Caches) StoreSpaceSummary(roomID string, r fclient.MSC2946SpacesResponse) { - c.SpaceSummaryRooms.Set(roomID, r) +func (c Caches) StoreRoomHierarchy(roomID string, r fclient.RoomHierarchyResponse) { + c.RoomHierarchies.Set(roomID, r) } |