mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-05 15:42:46 +00:00
refactor: funnel event creation through room versions (#3060)
In preparation of interfacing up the room version value.
This commit is contained in:
parent
72285b2659
commit
71eeccf34a
21 changed files with 41 additions and 35 deletions
|
@ -78,7 +78,7 @@ func InviteV1(
|
|||
) util.JSONResponse {
|
||||
roomVer := gomatrixserverlib.RoomVersionV1
|
||||
body := request.Content()
|
||||
event, err := gomatrixserverlib.NewEventFromTrustedJSON(body, false, roomVer)
|
||||
event, err := roomVer.NewEventFromTrustedJSON(body, false)
|
||||
switch err.(type) {
|
||||
case gomatrixserverlib.BadJSONError:
|
||||
return util.JSONResponse{
|
||||
|
@ -157,7 +157,7 @@ func processInvite(
|
|||
}
|
||||
|
||||
// Check that the event is signed by the server sending the request.
|
||||
redacted, err := gomatrixserverlib.RedactEventJSON(event.JSON(), event.Version())
|
||||
redacted, err := event.Version().RedactEventJSON(event.JSON())
|
||||
if err != nil {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusBadRequest,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue