syn2mas: fix handling of Synapse user_consent config

Closes #3928
This commit is contained in:
Olivier 'reivilibre
2025-03-18 15:57:40 +00:00
parent 984a52f121
commit a55b349a80
2 changed files with 8 additions and 3 deletions

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);
}

View File

@@ -36,7 +36,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 +297,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 {}