mirror of
https://github.com/matrix-org/dendrite.git
synced 2024-11-22 14:21:55 -06:00
No need to get the roomVersion twice
This commit is contained in:
parent
55a01df5c9
commit
f4e8ed6f1f
|
@ -199,16 +199,8 @@ func SendLeave(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
roomVersion, err := rsAPI.QueryRoomVersionForRoom(httpReq.Context(), roomID)
|
|
||||||
if err != nil {
|
|
||||||
return util.JSONResponse{
|
|
||||||
Code: http.StatusBadRequest,
|
|
||||||
JSON: spec.UnsupportedRoomVersion(err.Error()),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
leaveEvent, err := gomatrixserverlib.HandleSendLeave(
|
leaveEvent, err := gomatrixserverlib.HandleSendLeave(
|
||||||
httpReq.Context(), request.Content(), request.Origin(), roomVersion, eventID, roomID, rsAPI, keys)
|
httpReq.Context(), request.Content(), request.Origin(), roomInfo.RoomVersion, eventID, roomID, rsAPI, keys)
|
||||||
|
|
||||||
switch e := err.(type) {
|
switch e := err.(type) {
|
||||||
case nil:
|
case nil:
|
||||||
|
|
Loading…
Reference in a new issue