Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/syn2mas/src/synapse_reader/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down
9 changes: 8 additions & 1 deletion crates/syn2mas/src/synapse_reader/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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>,
Expand Down Expand Up @@ -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 {}
Loading