mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-18 04:13:10 -06:00
Try to determine room version for SendJoin
This commit is contained in:
parent
dc7028b3ab
commit
5bb15c1590
|
|
@ -116,7 +116,16 @@ func SendJoin(
|
||||||
keys gomatrixserverlib.KeyRing,
|
keys gomatrixserverlib.KeyRing,
|
||||||
roomID, eventID string,
|
roomID, eventID string,
|
||||||
) util.JSONResponse {
|
) util.JSONResponse {
|
||||||
event, err := gomatrixserverlib.NewEventFromUntrustedJSON(request.Content())
|
vReq := api.QueryRoomVersionForRoomIDRequest{RoomID: roomID}
|
||||||
|
vRes := api.QueryRoomVersionForRoomIDResponse{}
|
||||||
|
if query.QueryRoomVersionForRoomID(httpReq.Context(), &vReq, &vRes) != nil {
|
||||||
|
return util.JSONResponse{
|
||||||
|
Code: http.StatusBadRequest,
|
||||||
|
JSON: jsonerror.NotJSON("Couldn't determine the room version for this room."),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
event, err := gomatrixserverlib.NewEventFromUntrustedJSON(request.Content(), vRes.RoomVersion)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusBadRequest,
|
Code: http.StatusBadRequest,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue