From f4e8ed6f1f287bd409bd88506092da696dfdf069 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Thu, 23 Nov 2023 13:02:03 +0100 Subject: [PATCH] No need to get the roomVersion twice --- federationapi/routing/leave.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/federationapi/routing/leave.go b/federationapi/routing/leave.go index c4b46af93..2612f6101 100644 --- a/federationapi/routing/leave.go +++ b/federationapi/routing/leave.go @@ -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: