aboutsummaryrefslogtreecommitdiff
path: root/internal/caching/cache_space_rooms.go
blob: 90eeb7861c851e4eb15ee40386bddb9f4bfb0139 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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)
}