diff --git a/clientapi/routing/routing.go b/clientapi/routing/routing.go index 8dbfc551d..7c320253d 100644 --- a/clientapi/routing/routing.go +++ b/clientapi/routing/routing.go @@ -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{ + Versions []string `json:"versions"` + 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) diff --git a/setup/config/config.go b/setup/config/config.go index b8b12d0c1..b91144078 100644 --- a/setup/config/config.go +++ b/setup/config/config.go @@ -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 diff --git a/setup/config/config_clientapi.go b/setup/config/config_clientapi.go index 521154911..c7cb9c33e 100644 --- a/setup/config/config_clientapi.go +++ b/setup/config/config_clientapi.go @@ -37,6 +37,8 @@ type ClientAPI struct { // Rate-limiting options RateLimiting RateLimiting `yaml:"rate_limiting"` + + MSCs *MSCs `yaml:"mscs"` } func (c *ClientAPI) Defaults() {