matrix: E2EE as build option

since this is so broken and requires CGO deps, E2EE support is now only
included with "make E2EE=on ...". The option to enable will then appear
in settings.
This commit is contained in:
Harvey Tindall
2021-07-16 15:41:08 +01:00
parent 7f37633423
commit 762d5325fb
6 changed files with 98 additions and 40 deletions

10
api.go
View File

@@ -1667,6 +1667,16 @@ func (app *appContext) GetConfig(gc *gin.Context) {
}
}
}
if !MatrixE2EE() {
delete(resp.Sections["matrix"].Settings, "encryption")
for i, v := range resp.Sections["matrix"].Order {
if v == "encryption" {
sect := resp.Sections["matrix"]
sect.Order = append(sect.Order[:i], sect.Order[i+1:]...)
resp.Sections["matrix"] = sect
}
}
}
for sectName, section := range resp.Sections {
for settingName, setting := range section.Settings {
val := app.config.Section(sectName).Key(settingName)