From 783012a066c1647fe95cd2b0b8cb34523ff304e1 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Mon, 24 Apr 2023 10:40:17 +0200 Subject: [PATCH] Cleanup --- clientapi/routing/admin.go | 4 ++-- clientapi/routing/routing.go | 2 +- roomserver/api/perform.go | 36 ----------------------------------- roomserver/roomserver_test.go | 3 +-- 4 files changed, 4 insertions(+), 41 deletions(-) diff --git a/clientapi/routing/admin.go b/clientapi/routing/admin.go index 6e2120161..81a110858 100644 --- a/clientapi/routing/admin.go +++ b/clientapi/routing/admin.go @@ -211,7 +211,7 @@ func AdminMarkAsStale(req *http.Request, cfg *config.ClientAPI, keyAPI api.Clien } } -func AdminDownloadState(req *http.Request, cfg *config.ClientAPI, device *api.Device, rsAPI roomserverAPI.ClientRoomserverAPI) util.JSONResponse { +func AdminDownloadState(req *http.Request, device *api.Device, rsAPI roomserverAPI.ClientRoomserverAPI) util.JSONResponse { vars, err := httputil.URLDecodeMapValues(mux.Vars(req)) if err != nil { return util.ErrorResponse(err) @@ -240,6 +240,6 @@ func AdminDownloadState(req *http.Request, cfg *config.ClientAPI, device *api.De } return util.JSONResponse{ Code: 200, - JSON: map[string]interface{}{}, + JSON: struct{}{}, } } diff --git a/clientapi/routing/routing.go b/clientapi/routing/routing.go index 22231724d..70299e14d 100644 --- a/clientapi/routing/routing.go +++ b/clientapi/routing/routing.go @@ -180,7 +180,7 @@ func Setup( dendriteAdminRouter.Handle("/admin/downloadState/{serverName}/{roomID}", httputil.MakeAdminAPI("admin_download_state", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse { - return AdminDownloadState(req, cfg, device, rsAPI) + return AdminDownloadState(req, device, rsAPI) }), ).Methods(http.MethodGet, http.MethodOptions) diff --git a/roomserver/api/perform.go b/roomserver/api/perform.go index e125a3008..67d6e52f2 100644 --- a/roomserver/api/perform.go +++ b/roomserver/api/perform.go @@ -224,39 +224,3 @@ type PerformRoomUpgradeResponse struct { NewRoomID string Error *PerformError } - -type PerformAdminEvacuateRoomRequest struct { - RoomID string `json:"room_id"` -} - -type PerformAdminEvacuateRoomResponse struct { - Affected []string `json:"affected"` - Error *PerformError -} - -type PerformAdminEvacuateUserRequest struct { - UserID string `json:"user_id"` -} - -type PerformAdminEvacuateUserResponse struct { - Affected []string `json:"affected"` - Error *PerformError -} - -type PerformAdminPurgeRoomRequest struct { - RoomID string `json:"room_id"` -} - -type PerformAdminPurgeRoomResponse struct { - Error *PerformError `json:"error,omitempty"` -} - -type PerformAdminDownloadStateRequest struct { - RoomID string `json:"room_id"` - UserID string `json:"user_id"` - ServerName spec.ServerName `json:"server_name"` -} - -type PerformAdminDownloadStateResponse struct { - Error *PerformError `json:"error,omitempty"` -} diff --git a/roomserver/roomserver_test.go b/roomserver/roomserver_test.go index 67d6db46f..307a1582d 100644 --- a/roomserver/roomserver_test.go +++ b/roomserver/roomserver_test.go @@ -325,8 +325,7 @@ func TestPurgeRoom(t *testing.T) { } // purge the room from the database - purgeResp := &api.PerformAdminPurgeRoomResponse{} - if err = rsAPI.PerformAdminPurgeRoom(ctx, &api.PerformAdminPurgeRoomRequest{RoomID: room.ID}, purgeResp); err != nil { + if err = rsAPI.PerformAdminPurgeRoom(ctx, room.ID); err != nil { t.Fatal(err) }