diff options
Diffstat (limited to 'roomserver/inthttp/server.go')
-rw-r--r-- | roomserver/inthttp/server.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/roomserver/inthttp/server.go b/roomserver/inthttp/server.go index c7e541dd..9c9d4d4a 100644 --- a/roomserver/inthttp/server.go +++ b/roomserver/inthttp/server.go @@ -126,6 +126,20 @@ func AddRoutes(r api.RoomserverInternalAPI, internalAPIMux *mux.Router) { }), ) internalAPIMux.Handle( + RoomserverQueryMissingAuthPrevEventsPath, + httputil.MakeInternalAPI("queryMissingAuthPrevEvents", func(req *http.Request) util.JSONResponse { + var request api.QueryMissingAuthPrevEventsRequest + var response api.QueryMissingAuthPrevEventsResponse + if err := json.NewDecoder(req.Body).Decode(&request); err != nil { + return util.ErrorResponse(err) + } + if err := r.QueryMissingAuthPrevEvents(req.Context(), &request, &response); err != nil { + return util.ErrorResponse(err) + } + return util.JSONResponse{Code: http.StatusOK, JSON: &response} + }), + ) + internalAPIMux.Handle( RoomserverQueryEventsByIDPath, httputil.MakeInternalAPI("queryEventsByID", func(req *http.Request) util.JSONResponse { var request api.QueryEventsByIDRequest |