mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-15 02:43:09 -06:00
Added matrix configuration to function args for access to homeserver string
This commit is contained in:
parent
25504f20f3
commit
0fa7122d63
|
|
@ -51,7 +51,7 @@ func Setup(
|
||||||
).Methods(http.MethodGet, http.MethodOptions)
|
).Methods(http.MethodGet, http.MethodOptions)
|
||||||
appMux.Handle("/user",
|
appMux.Handle("/user",
|
||||||
common.MakeExternalAPI("user", func(req *http.Request) util.JSONResponse {
|
common.MakeExternalAPI("user", func(req *http.Request) util.JSONResponse {
|
||||||
return URIToUID(req)
|
return URIToUID(req, cfg)
|
||||||
}),
|
}),
|
||||||
).Methods(http.MethodGet, http.MethodOptions)
|
).Methods(http.MethodGet, http.MethodOptions)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,9 @@ type URIToUIDResponse struct {
|
||||||
// URI and turning it into a Matrix ID on the homeserver.
|
// URI and turning it into a Matrix ID on the homeserver.
|
||||||
// https://matrix.org/docs/spec/application_service/unstable.html#user-ids
|
// https://matrix.org/docs/spec/application_service/unstable.html#user-ids
|
||||||
|
|
||||||
func URIToUID(req *http.Request) util.JSONResponse {
|
func URIToUID(req *http.Request, cfg config.Dendrite) util.JSONResponse {
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
|
homeserver := cfg.Matrix.ServerName
|
||||||
return util.JSONResponse{
|
return util.JSONResponse{
|
||||||
Code: http.StatusOK,
|
Code: http.StatusOK,
|
||||||
JSON: nil,
|
JSON: nil,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue