mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 13:22:46 +00:00
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
This commit is contained in:
parent
9b98e5a102
commit
6284790f98
22 changed files with 28 additions and 44 deletions
|
@ -543,7 +543,7 @@ func (d *EventDatabase) events(
|
|||
}
|
||||
|
||||
sort.Sort(inputEventNIDs)
|
||||
events := make(map[types.EventNID]*gomatrixserverlib.Event, len(inputEventNIDs))
|
||||
events := make(map[types.EventNID]gomatrixserverlib.PDU, len(inputEventNIDs))
|
||||
eventNIDs := make([]types.EventNID, 0, len(inputEventNIDs))
|
||||
for _, nid := range inputEventNIDs {
|
||||
if event, ok := d.Cache.GetRoomServerEvent(nid); ok && event != nil {
|
||||
|
@ -593,7 +593,7 @@ func (d *EventDatabase) events(
|
|||
return nil, err
|
||||
}
|
||||
if event := events[eventJSON.EventNID]; event != nil {
|
||||
d.Cache.StoreRoomServerEvent(eventJSON.EventNID, event)
|
||||
d.Cache.StoreRoomServerEvent(eventJSON.EventNID, &types.HeaderedEvent{PDU: event})
|
||||
}
|
||||
}
|
||||
results := make([]types.Event, 0, len(inputEventNIDs))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue