mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 18:43:10 -06:00
Cleanup
This commit is contained in:
parent
5fe950cc61
commit
783012a066
|
|
@ -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))
|
vars, err := httputil.URLDecodeMapValues(mux.Vars(req))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return util.ErrorResponse(err)
|
return util.ErrorResponse(err)
|
||||||
|
|
@ -240,6 +240,6 @@ func AdminDownloadState(req *http.Request, cfg *config.ClientAPI, device *api.De
|
||||||
}
|
}
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: 200,
|
Code: 200,
|
||||||
JSON: map[string]interface{}{},
|
JSON: struct{}{},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ func Setup(
|
||||||
|
|
||||||
dendriteAdminRouter.Handle("/admin/downloadState/{serverName}/{roomID}",
|
dendriteAdminRouter.Handle("/admin/downloadState/{serverName}/{roomID}",
|
||||||
httputil.MakeAdminAPI("admin_download_state", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse {
|
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)
|
).Methods(http.MethodGet, http.MethodOptions)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -224,39 +224,3 @@ type PerformRoomUpgradeResponse struct {
|
||||||
NewRoomID string
|
NewRoomID string
|
||||||
Error *PerformError
|
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"`
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -325,8 +325,7 @@ func TestPurgeRoom(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// purge the room from the database
|
// purge the room from the database
|
||||||
purgeResp := &api.PerformAdminPurgeRoomResponse{}
|
if err = rsAPI.PerformAdminPurgeRoom(ctx, room.ID); err != nil {
|
||||||
if err = rsAPI.PerformAdminPurgeRoom(ctx, &api.PerformAdminPurgeRoomRequest{RoomID: room.ID}, purgeResp); err != nil {
|
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue