diff options
author | kegsay <kegan@matrix.org> | 2023-05-03 10:21:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-03 10:21:27 +0100 |
commit | 6284790f986b922877895a3db31ca2723509dbf9 (patch) | |
tree | f9426d8be7004aa33ed9dc75ab483af484f96d83 /internal/caching/cache_roomevents.go | |
parent | 9b98e5a10282dbf594f46a41baa21191b2d2b8f6 (diff) |
Use PDU in even more places (#3074)
- No longer rely on *Event returning from NewEventFrom... functions
Requires https://github.com/matrix-org/gomatrixserverlib/pull/377
Diffstat (limited to 'internal/caching/cache_roomevents.go')
-rw-r--r-- | internal/caching/cache_roomevents.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/internal/caching/cache_roomevents.go b/internal/caching/cache_roomevents.go index 14b6c3af..e8bbe208 100644 --- a/internal/caching/cache_roomevents.go +++ b/internal/caching/cache_roomevents.go @@ -2,22 +2,21 @@ package caching import ( "github.com/matrix-org/dendrite/roomserver/types" - "github.com/matrix-org/gomatrixserverlib" ) // RoomServerEventsCache contains the subset of functions needed for // a roomserver event cache. type RoomServerEventsCache interface { - GetRoomServerEvent(eventNID types.EventNID) (*gomatrixserverlib.Event, bool) - StoreRoomServerEvent(eventNID types.EventNID, event *gomatrixserverlib.Event) + GetRoomServerEvent(eventNID types.EventNID) (*types.HeaderedEvent, bool) + StoreRoomServerEvent(eventNID types.EventNID, event *types.HeaderedEvent) InvalidateRoomServerEvent(eventNID types.EventNID) } -func (c Caches) GetRoomServerEvent(eventNID types.EventNID) (*gomatrixserverlib.Event, bool) { +func (c Caches) GetRoomServerEvent(eventNID types.EventNID) (*types.HeaderedEvent, bool) { return c.RoomServerEvents.Get(int64(eventNID)) } -func (c Caches) StoreRoomServerEvent(eventNID types.EventNID, event *gomatrixserverlib.Event) { +func (c Caches) StoreRoomServerEvent(eventNID types.EventNID, event *types.HeaderedEvent) { c.RoomServerEvents.Set(int64(eventNID), event) } |