From 6106ec1399b4dd2dc90ca577cfcb1ec019f05507 Mon Sep 17 00:00:00 2001 From: Alex Chen Date: Wed, 10 Jul 2019 00:13:43 +0800 Subject: [PATCH] Fix getAliasesForRoomID has no HTTP handler in aliasAPI (#705) This PR adds back the HTTP handler for internal API GetAliasesForRoomID in roomserver, which seemed to be missing. --- roomserver/alias/alias.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/roomserver/alias/alias.go b/roomserver/alias/alias.go index 6a34aacdd..f699e3362 100644 --- a/roomserver/alias/alias.go +++ b/roomserver/alias/alias.go @@ -277,6 +277,20 @@ func (r *RoomserverAliasAPI) SetupHTTP(servMux *http.ServeMux) { return util.JSONResponse{Code: http.StatusOK, JSON: &response} }), ) + servMux.Handle( + roomserverAPI.RoomserverGetAliasesForRoomIDPath, + common.MakeInternalAPI("getAliasesForRoomID", func(req *http.Request) util.JSONResponse { + var request roomserverAPI.GetAliasesForRoomIDRequest + var response roomserverAPI.GetAliasesForRoomIDResponse + if err := json.NewDecoder(req.Body).Decode(&request); err != nil { + return util.ErrorResponse(err) + } + if err := r.GetAliasesForRoomID(req.Context(), &request, &response); err != nil { + return util.ErrorResponse(err) + } + return util.JSONResponse{Code: http.StatusOK, JSON: &response} + }), + ) servMux.Handle( roomserverAPI.RoomserverRemoveRoomAliasPath, common.MakeInternalAPI("removeRoomAlias", func(req *http.Request) util.JSONResponse {