diff options
author | kegsay <kegan@matrix.org> | 2023-04-27 16:35:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-27 16:35:19 +0100 |
commit | 617131030707aacd39f0f771626eaa5b8f88299c (patch) | |
tree | 41c91962f6235871e5178bae4fd174ef58dffd05 /syncapi/streams | |
parent | c6457cd4e551017246af7ddcece212edfb927076 (diff) |
Use PDU interface (#3070)
We only use it in a few places currently, enough to get things to
compile and run. We should be using it in much more places.
Similarly, in some places we cast []PDU back to []*Event, we need to not
do that. Likewise, in some places we cast PDU to *Event, we need to not
do that. For now though, hopefully this is a start.
Diffstat (limited to 'syncapi/streams')
-rw-r--r-- | syncapi/streams/stream_pdu.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/syncapi/streams/stream_pdu.go b/syncapi/streams/stream_pdu.go index 723dd88f..e024dfae 100644 --- a/syncapi/streams/stream_pdu.go +++ b/syncapi/streams/stream_pdu.go @@ -279,13 +279,13 @@ func (p *PDUStreamProvider) addRoomDeltaToResponse( hisVisMap[re.EventID()] = re.Visibility } recEvents := gomatrixserverlib.HeaderedReverseTopologicalOrdering( - toEvents(snapshot.StreamEventsToEvents(device, recentStreamEvents)), + gomatrixserverlib.ToPDUs(toEvents(snapshot.StreamEventsToEvents(device, recentStreamEvents))), gomatrixserverlib.TopologicalOrderByPrevEvents, ) recentEvents := make([]*rstypes.HeaderedEvent, len(recEvents)) for i := range recEvents { recentEvents[i] = &rstypes.HeaderedEvent{ - Event: recEvents[i], + Event: recEvents[i].(*gomatrixserverlib.Event), Visibility: hisVisMap[recEvents[i].EventID()], } } @@ -358,13 +358,13 @@ func (p *PDUStreamProvider) addRoomDeltaToResponse( hisVisMap[re.EventID()] = re.Visibility } sEvents := gomatrixserverlib.HeaderedReverseTopologicalOrdering( - toEvents(removeDuplicates(delta.StateEvents, events)), + gomatrixserverlib.ToPDUs(toEvents(removeDuplicates(delta.StateEvents, events))), gomatrixserverlib.TopologicalOrderByAuthEvents, ) delta.StateEvents = make([]*rstypes.HeaderedEvent, len(sEvents)) for i := range sEvents { delta.StateEvents[i] = &rstypes.HeaderedEvent{ - Event: sEvents[i], + Event: sEvents[i].(*gomatrixserverlib.Event), Visibility: hisVisMap[sEvents[i].EventID()], } } |