diff options
Diffstat (limited to 'roomserver/inthttp/server.go')
-rw-r--r-- | roomserver/inthttp/server.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/roomserver/inthttp/server.go b/roomserver/inthttp/server.go index f9c8ef9f..bf319262 100644 --- a/roomserver/inthttp/server.go +++ b/roomserver/inthttp/server.go @@ -72,6 +72,19 @@ func AddRoutes(r api.RoomserverInternalAPI, internalAPIMux *mux.Router) { return util.JSONResponse{Code: http.StatusOK, JSON: &response} }), ) + internalAPIMux.Handle(RoomserverPerformInboundPeekPath, + httputil.MakeInternalAPI("performInboundPeek", func(req *http.Request) util.JSONResponse { + var request api.PerformInboundPeekRequest + var response api.PerformInboundPeekResponse + if err := json.NewDecoder(req.Body).Decode(&request); err != nil { + return util.MessageResponse(http.StatusBadRequest, err.Error()) + } + if err := r.PerformInboundPeek(req.Context(), &request, &response); err != nil { + return util.ErrorResponse(err) + } + return util.JSONResponse{Code: http.StatusOK, JSON: &response} + }), + ) internalAPIMux.Handle(RoomserverPerformPeekPath, httputil.MakeInternalAPI("performUnpeek", func(req *http.Request) util.JSONResponse { var request api.PerformUnpeekRequest |