No need to get the roomVersion twice

This commit is contained in:
Till Faelligen 2023-11-23 13:02:03 +01:00
parent 55a01df5c9
commit f4e8ed6f1f
No known key found for this signature in database
GPG key ID: ACCDC9606D472758

View file

@ -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(
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) {
case nil: