mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-15 05:32:25 +03:00
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:
parent
c6457cd4e5
commit
6171310307
23 changed files with 96 additions and 77 deletions
|
@ -68,7 +68,7 @@ func (r *InboundPeeker) PerformInboundPeek(
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var sortedLatestEvents []*gomatrixserverlib.Event
|
||||
var sortedLatestEvents []gomatrixserverlib.PDU
|
||||
for _, ev := range latestEvents {
|
||||
sortedLatestEvents = append(sortedLatestEvents, ev.Event)
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ func (r *InboundPeeker) PerformInboundPeek(
|
|||
sortedLatestEvents,
|
||||
gomatrixserverlib.TopologicalOrderByPrevEvents,
|
||||
)
|
||||
response.LatestEvent = &types.HeaderedEvent{Event: sortedLatestEvents[0]}
|
||||
response.LatestEvent = &types.HeaderedEvent{Event: sortedLatestEvents[0].(*gomatrixserverlib.Event)}
|
||||
|
||||
// XXX: do we actually need to do a state resolution here?
|
||||
roomState := state.NewStateResolution(r.DB, info)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue