mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-17 03:43:11 -06:00
Improve the room version check
This commit is contained in:
parent
d44816090a
commit
67b47d98bd
|
|
@ -22,7 +22,7 @@ import (
|
||||||
"github.com/matrix-org/dendrite/clientapi/jsonerror"
|
"github.com/matrix-org/dendrite/clientapi/jsonerror"
|
||||||
"github.com/matrix-org/dendrite/clientapi/producers"
|
"github.com/matrix-org/dendrite/clientapi/producers"
|
||||||
"github.com/matrix-org/dendrite/common/config"
|
"github.com/matrix-org/dendrite/common/config"
|
||||||
"github.com/matrix-org/dendrite/roomserver/version"
|
roomserverVersion "github.com/matrix-org/dendrite/roomserver/version"
|
||||||
"github.com/matrix-org/gomatrixserverlib"
|
"github.com/matrix-org/gomatrixserverlib"
|
||||||
"github.com/matrix-org/util"
|
"github.com/matrix-org/util"
|
||||||
)
|
)
|
||||||
|
|
@ -47,7 +47,8 @@ func Invite(
|
||||||
event := inviteReq.Event()
|
event := inviteReq.Event()
|
||||||
|
|
||||||
// Check if we support the room version for the invite.
|
// Check if we support the room version for the invite.
|
||||||
if roomVersion, err := version.SupportedRoomVersion(inviteReq.RoomVersion()); err != nil {
|
roomVersion := inviteReq.RoomVersion()
|
||||||
|
if _, err := roomserverVersion.SupportedRoomVersion(roomVersion); err != nil {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusBadRequest,
|
Code: http.StatusBadRequest,
|
||||||
JSON: jsonerror.UnsupportedRoomVersion(
|
JSON: jsonerror.UnsupportedRoomVersion(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue