aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/caching/cache_roomservernids.go1
-rw-r--r--internal/caching/cache_space_rooms.go15
-rw-r--r--internal/caching/caches.go2
-rw-r--r--internal/caching/impl_ristretto.go2
4 files changed, 11 insertions, 9 deletions
diff --git a/internal/caching/cache_roomservernids.go b/internal/caching/cache_roomservernids.go
index 734a3a04..fa0781ef 100644
--- a/internal/caching/cache_roomservernids.go
+++ b/internal/caching/cache_roomservernids.go
@@ -8,6 +8,7 @@ type RoomServerCaches interface {
RoomServerNIDsCache
RoomVersionCache
RoomServerEventsCache
+ RoomHierarchyCache
EventStateKeyCache
EventTypeCache
}
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)
}
diff --git a/internal/caching/caches.go b/internal/caching/caches.go
index 6bae60d5..16e54757 100644
--- a/internal/caching/caches.go
+++ b/internal/caching/caches.go
@@ -35,7 +35,7 @@ type Caches struct {
RoomServerEventTypes Cache[types.EventTypeNID, string] // eventType NID -> eventType
FederationPDUs Cache[int64, *types.HeaderedEvent] // queue NID -> PDU
FederationEDUs Cache[int64, *gomatrixserverlib.EDU] // queue NID -> EDU
- SpaceSummaryRooms Cache[string, fclient.MSC2946SpacesResponse] // room ID -> space response
+ RoomHierarchies Cache[string, fclient.RoomHierarchyResponse] // room ID -> space response
LazyLoading Cache[lazyLoadingCacheKey, string] // composite key -> event ID
}
diff --git a/internal/caching/impl_ristretto.go b/internal/caching/impl_ristretto.go
index 00989b76..97ea9548 100644
--- a/internal/caching/impl_ristretto.go
+++ b/internal/caching/impl_ristretto.go
@@ -147,7 +147,7 @@ func NewRistrettoCache(maxCost config.DataUnit, maxAge time.Duration, enableProm
MaxAge: lesserOf(time.Hour/2, maxAge),
},
},
- SpaceSummaryRooms: &RistrettoCachePartition[string, fclient.MSC2946SpacesResponse]{ // room ID -> space response
+ RoomHierarchies: &RistrettoCachePartition[string, fclient.RoomHierarchyResponse]{ // room ID -> space response
cache: cache,
Prefix: spaceSummaryRoomsCache,
Mutable: true,