diff options
author | kegsay <kegan@matrix.org> | 2022-02-09 20:31:24 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-09 20:31:24 +0000 |
commit | aa5c3b88dea207410461820ee480b002d185aa54 (patch) | |
tree | 7249679bd4c8d84f796dbd11198074dd98a0ee53 /roomserver/api | |
parent | cc688a9a386f48e38687a697b50f9be7d2b06fb0 (diff) |
Unmarshal events at the Dendrite level not GMSL level (#2164)
* Use new event json types in gmsl
* Fix EventJSON to actually unmarshal events
* Update GMSL
* Bump GMSL and improve error messages
* Send back the correct RespState
* Update GMSL
Diffstat (limited to 'roomserver/api')
-rw-r--r-- | roomserver/api/wrapper.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/roomserver/api/wrapper.go b/roomserver/api/wrapper.go index e9b94e48..012094c6 100644 --- a/roomserver/api/wrapper.go +++ b/roomserver/api/wrapper.go @@ -51,7 +51,7 @@ func SendEventWithState( state *gomatrixserverlib.RespState, event *gomatrixserverlib.HeaderedEvent, origin gomatrixserverlib.ServerName, haveEventIDs map[string]bool, async bool, ) error { - outliers, err := state.Events() + outliers, err := state.Events(event.RoomVersion) if err != nil { return err } @@ -68,9 +68,10 @@ func SendEventWithState( }) } - stateEventIDs := make([]string, len(state.StateEvents)) - for i := range state.StateEvents { - stateEventIDs[i] = state.StateEvents[i].EventID() + stateEvents := state.StateEvents.UntrustedEvents(event.RoomVersion) + stateEventIDs := make([]string, len(stateEvents)) + for i := range stateEvents { + stateEventIDs[i] = stateEvents[i].EventID() } ires = append(ires, InputRoomEvent{ |