mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-02-15 15:34:28 -06:00
add the route
This commit is contained in:
parent
8422ef6433
commit
0f80b26b4e
|
@ -157,6 +157,16 @@ func Setup(
|
||||||
}, httputil.WithAllowGuests()),
|
}, httputil.WithAllowGuests()),
|
||||||
).Methods(http.MethodGet, http.MethodOptions)
|
).Methods(http.MethodGet, http.MethodOptions)
|
||||||
|
|
||||||
|
v1unstablemux.Handle("/rooms/{roomId}/threads", httputil.MakeAuthAPI("threads", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse {
|
||||||
|
vars, err := httputil.URLDecodeMapValues(mux.Vars(req))
|
||||||
|
if err != nil {
|
||||||
|
return util.ErrorResponse(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return Threads(
|
||||||
|
req, device, syncDB, rsAPI, vars["roomId"],
|
||||||
|
)
|
||||||
|
}))
|
||||||
v3mux.Handle("/search",
|
v3mux.Handle("/search",
|
||||||
httputil.MakeAuthAPI("search", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse {
|
httputil.MakeAuthAPI("search", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse {
|
||||||
if !cfg.Fulltext.Enabled {
|
if !cfg.Fulltext.Enabled {
|
||||||
|
@ -200,4 +210,5 @@ func Setup(
|
||||||
return GetMemberships(req, device, vars["roomID"], syncDB, rsAPI, membership, notMembership, at)
|
return GetMemberships(req, device, vars["roomID"], syncDB, rsAPI, membership, notMembership, at)
|
||||||
}, httputil.WithAllowGuests()),
|
}, httputil.WithAllowGuests()),
|
||||||
).Methods(http.MethodGet, http.MethodOptions)
|
).Methods(http.MethodGet, http.MethodOptions)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ type ThreadsResponse struct {
|
||||||
|
|
||||||
func Threads(
|
func Threads(
|
||||||
req *http.Request,
|
req *http.Request,
|
||||||
device userapi.Device,
|
device *userapi.Device,
|
||||||
syncDB storage.Database,
|
syncDB storage.Database,
|
||||||
rsAPI api.SyncRoomserverAPI,
|
rsAPI api.SyncRoomserverAPI,
|
||||||
rawRoomID string) util.JSONResponse {
|
rawRoomID string) util.JSONResponse {
|
||||||
|
|
Loading…
Reference in a new issue