Added matrix configuration to function args for access to homeserver string

This commit is contained in:
Derek Meer 2018-08-01 20:01:58 -07:00
parent 25504f20f3
commit 0fa7122d63
2 changed files with 3 additions and 2 deletions

View file

@ -51,7 +51,7 @@ func Setup(
).Methods(http.MethodGet, http.MethodOptions)
appMux.Handle("/user",
common.MakeExternalAPI("user", func(req *http.Request) util.JSONResponse {
return URIToUID(req)
return URIToUID(req, cfg)
}),
).Methods(http.MethodGet, http.MethodOptions)
}

View file

@ -16,8 +16,9 @@ type URIToUIDResponse struct {
// URI and turning it into a Matrix ID on the homeserver.
// 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
homeserver := cfg.Matrix.ServerName
return util.JSONResponse{
Code: http.StatusOK,
JSON: nil,