mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-08 18:16:59 +00:00
9582827493
- 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>
18 lines
617 B
Go
18 lines
617 B
Go
package caching
|
|
|
|
import "github.com/matrix-org/gomatrixserverlib/fclient"
|
|
|
|
// 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) GetRoomHierarchy(roomID string) (r fclient.RoomHierarchyResponse, ok bool) {
|
|
return c.RoomHierarchies.Get(roomID)
|
|
}
|
|
|
|
func (c Caches) StoreRoomHierarchy(roomID string, r fclient.RoomHierarchyResponse) {
|
|
c.RoomHierarchies.Set(roomID, r)
|
|
}
|