syn2mas: Synapse configuration fixes (#4266)

This commit is contained in:
reivilibre
2025-03-18 16:38:37 +00:00
committed by GitHub
2 changed files with 10 additions and 3 deletions
+2 -2
View File
@@ -136,7 +136,7 @@ pub fn synapse_config_check(synapse_config: &Config) -> (Vec<CheckWarning>, Vec<
if synapse_config.enable_registration {
warnings.push(CheckWarning::DisableRegistrationAfterMigration);
}
if synapse_config.user_consent {
if synapse_config.user_consent.is_some() {
warnings.push(CheckWarning::DisableUserConsentAfterMigration);
}
@@ -232,7 +232,7 @@ pub async fn synapse_config_check_against_mas_config(
}
let mas_branding = BrandingConfig::extract_or_default(mas)?;
if synapse.user_consent && mas_branding.tos_uri.is_none() {
if synapse.user_consent.is_some() && mas_branding.tos_uri.is_none() {
warnings.push(CheckWarning::ShouldPortUserConsentAsTerms);
}
+8 -1
View File
@@ -19,6 +19,8 @@ use sqlx::postgres::PgConnectOptions;
#[allow(clippy::struct_excessive_bools)]
pub struct Config {
pub database: DatabaseSection,
#[serde(default)]
pub password_config: PasswordSection,
#[serde(default)]
@@ -36,7 +38,7 @@ pub struct Config {
pub enable_3pid_changes: bool,
#[serde(default)]
pub user_consent: bool,
pub user_consent: Option<UserConsentSection>,
#[serde(default)]
pub registrations_require_3pid: Vec<String>,
@@ -297,3 +299,8 @@ mod test {
);
}
}
/// We don't care about any of the fields in this section,
/// just whether it's present.
#[derive(Deserialize)]
pub struct UserConsentSection {}