diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2022-06-29 15:29:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-29 15:29:39 +0100 |
commit | 519bc1124b051273019aae9b11617ebd796e962f (patch) | |
tree | 63445e1384d880e2ab94a1847f6a11553f822547 /roomserver/inthttp/server.go | |
parent | 2dea466685d0d4ab74d4cbd84af16b621d1269b3 (diff) |
Add `evacuateUser` endpoint, use it when deactivating accounts (#2545)
* Add `evacuateUser` endpoint, use it when deactivating accounts
* Populate the API
* Clean up user devices when deactivating
* Include invites, delete pushers
Diffstat (limited to 'roomserver/inthttp/server.go')
-rw-r--r-- | roomserver/inthttp/server.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/roomserver/inthttp/server.go b/roomserver/inthttp/server.go index ad4fdc46..99338158 100644 --- a/roomserver/inthttp/server.go +++ b/roomserver/inthttp/server.go @@ -129,6 +129,17 @@ func AddRoutes(r api.RoomserverInternalAPI, internalAPIMux *mux.Router) { return util.JSONResponse{Code: http.StatusOK, JSON: &response} }), ) + internalAPIMux.Handle(RoomserverPerformAdminEvacuateUserPath, + httputil.MakeInternalAPI("performAdminEvacuateUser", func(req *http.Request) util.JSONResponse { + var request api.PerformAdminEvacuateUserRequest + var response api.PerformAdminEvacuateUserResponse + if err := json.NewDecoder(req.Body).Decode(&request); err != nil { + return util.MessageResponse(http.StatusBadRequest, err.Error()) + } + r.PerformAdminEvacuateUser(req.Context(), &request, &response) + return util.JSONResponse{Code: http.StatusOK, JSON: &response} + }), + ) internalAPIMux.Handle( RoomserverQueryPublishedRoomsPath, httputil.MakeInternalAPI("queryPublishedRooms", func(req *http.Request) util.JSONResponse { |