Use IRoomVersion (#3064)

This is a step towards allowing arbitrary room version impls.
This commit is contained in:
kegsay 2023-04-24 11:50:37 +01:00 committed by GitHub
parent 1647213fac
commit 4679098a64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 25 additions and 20 deletions

View file

@ -77,6 +77,7 @@ func InviteV1(
) util.JSONResponse {
roomVer := gomatrixserverlib.RoomVersionV1
body := request.Content()
// roomVer is hardcoded to v1 so we know we won't panic on Must
event, err := gomatrixserverlib.MustGetRoomVersion(roomVer).NewEventFromTrustedJSON(body, false)
switch err.(type) {
case gomatrixserverlib.BadJSONError: