mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-29 12:42:46 +00:00
Gate peeking behind msc flags (#1731)
This commit is contained in:
parent
0571d395b5
commit
93942f8ab6
11 changed files with 76 additions and 47 deletions
|
@ -3,7 +3,11 @@ package config
|
|||
type MSCs struct {
|
||||
Matrix *Global `yaml:"-"`
|
||||
|
||||
// The MSCs to enable
|
||||
// The MSCs to enable. Supported MSCs include:
|
||||
// 'msc2444': Peeking over federation - https://github.com/matrix-org/matrix-doc/pull/2444
|
||||
// 'msc2753': Peeking via /sync - https://github.com/matrix-org/matrix-doc/pull/2753
|
||||
// 'msc2836': Threading - https://github.com/matrix-org/matrix-doc/pull/2836
|
||||
// 'msc2946': Spaces Summary - https://github.com/matrix-org/matrix-doc/pull/2946
|
||||
MSCs []string `yaml:"mscs"`
|
||||
|
||||
Database DatabaseOptions `yaml:"database"`
|
||||
|
@ -14,6 +18,16 @@ func (c *MSCs) Defaults() {
|
|||
c.Database.ConnectionString = "file:mscs.db"
|
||||
}
|
||||
|
||||
// Enabled returns true if the given msc is enabled. Should in the form 'msc12345'.
|
||||
func (c *MSCs) Enabled(msc string) bool {
|
||||
for _, m := range c.MSCs {
|
||||
if m == msc {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (c *MSCs) Verify(configErrs *ConfigErrors, isMonolith bool) {
|
||||
checkNotEmpty(configErrs, "mscs.database.connection_string", string(c.Database.ConnectionString))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue