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.
This commit is contained in:
kegsay 2023-04-27 16:35:19 +01:00 committed by GitHub
parent c6457cd4e5
commit 6171310307
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 96 additions and 77 deletions

View file

@ -55,7 +55,8 @@ func SendEventWithState(
state gomatrixserverlib.StateResponse, event *types.HeaderedEvent,
origin spec.ServerName, haveEventIDs map[string]bool, async bool,
) error {
outliers := gomatrixserverlib.LineariseStateResponse(event.Version(), state)
outliersPDU := gomatrixserverlib.LineariseStateResponse(event.Version(), state)
outliers := gomatrixserverlib.TempCastToEvents(outliersPDU)
ires := make([]InputRoomEvent, 0, len(outliers))
for _, outlier := range outliers {
if haveEventIDs[outlier.EventID()] {