diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2020-05-04 18:34:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-04 18:34:09 +0100 |
commit | 9b1b095b495a5cd4a6494bc309dd8c4e92d8661f (patch) | |
tree | f65566a84ed4524a6dbd4c45deac63d175c2f94b /federationapi | |
parent | df80e424081ff962a137b05b977d465f1c97a481 (diff) |
Roomserver perform leave (#1004)
* First pass at PerformLeave
* Fix SQLite bulkSelectEventStateKey
* Update gomatrixserverlib
* Fix bugs
* Tidy a bit
* Satisfy King Linter
* Review comments
* Review comments
* Fix constants in SQLite event state keys table
Diffstat (limited to 'federationapi')
-rw-r--r-- | federationapi/routing/leave.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/federationapi/routing/leave.go b/federationapi/routing/leave.go index 1124bfa2..bab3fd0b 100644 --- a/federationapi/routing/leave.go +++ b/federationapi/routing/leave.go @@ -33,6 +33,15 @@ func MakeLeave( rsAPI api.RoomserverInternalAPI, roomID, userID string, ) util.JSONResponse { + verReq := api.QueryRoomVersionForRoomRequest{RoomID: roomID} + verRes := api.QueryRoomVersionForRoomResponse{} + if err := rsAPI.QueryRoomVersionForRoom(httpReq.Context(), &verReq, &verRes); err != nil { + return util.JSONResponse{ + Code: http.StatusInternalServerError, + JSON: jsonerror.InternalServerError(), + } + } + _, domain, err := gomatrixserverlib.SplitID('@', userID) if err != nil { return util.JSONResponse{ @@ -87,7 +96,10 @@ func MakeLeave( return util.JSONResponse{ Code: http.StatusOK, - JSON: map[string]interface{}{"event": builder}, + JSON: map[string]interface{}{ + "room_version": verRes.RoomVersion, + "event": builder, + }, } } |