mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 07:28:27 +00:00
Mention unstable features in /_matrix/client/versions (#1710)
* Mention unstable features in /_matrix/client/versions * list enabled mscs * Don't update go.mod/go.sum * goimports Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
This commit is contained in:
parent
534c29ab02
commit
dd1e31bee7
3 changed files with 12 additions and 3 deletions
|
@ -62,13 +62,19 @@ func Setup(
|
|||
rateLimits := newRateLimits(&cfg.RateLimiting)
|
||||
userInteractiveAuth := auth.NewUserInteractive(accountDB.GetAccountByPassword, cfg)
|
||||
|
||||
unstableFeatures := make(map[string]bool)
|
||||
for _, msc := range cfg.MSCs.MSCs {
|
||||
unstableFeatures["org.matrix."+msc] = true
|
||||
}
|
||||
|
||||
publicAPIMux.Handle("/versions",
|
||||
httputil.MakeExternalAPI("versions", func(req *http.Request) util.JSONResponse {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusOK,
|
||||
JSON: struct {
|
||||
Versions []string `json:"versions"`
|
||||
}{[]string{
|
||||
UnstableFeatures map[string]bool `json:"unstable_features"`
|
||||
}{Versions: []string{
|
||||
"r0.0.1",
|
||||
"r0.1.0",
|
||||
"r0.2.0",
|
||||
|
@ -76,7 +82,7 @@ func Setup(
|
|||
"r0.4.0",
|
||||
"r0.5.0",
|
||||
"r0.6.1",
|
||||
}},
|
||||
}, UnstableFeatures: unstableFeatures},
|
||||
}
|
||||
}),
|
||||
).Methods(http.MethodGet, http.MethodOptions)
|
||||
|
|
|
@ -344,6 +344,7 @@ func (c *Dendrite) Wiring() {
|
|||
|
||||
c.ClientAPI.Derived = &c.Derived
|
||||
c.AppServiceAPI.Derived = &c.Derived
|
||||
c.ClientAPI.MSCs = &c.MSCs
|
||||
}
|
||||
|
||||
// Error returns a string detailing how many errors were contained within a
|
||||
|
|
|
@ -37,6 +37,8 @@ type ClientAPI struct {
|
|||
|
||||
// Rate-limiting options
|
||||
RateLimiting RateLimiting `yaml:"rate_limiting"`
|
||||
|
||||
MSCs *MSCs `yaml:"mscs"`
|
||||
}
|
||||
|
||||
func (c *ClientAPI) Defaults() {
|
||||
|
|
Loading…
Reference in a new issue