Skip to content

Commit ec92da7

Browse files
authored
syn2mas: Synapse configuration fixes (#4266)
2 parents cf587e9 + d28b1cc commit ec92da7

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

crates/syn2mas/src/synapse_reader/checks.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ pub fn synapse_config_check(synapse_config: &Config) -> (Vec<CheckWarning>, Vec<
136136
if synapse_config.enable_registration {
137137
warnings.push(CheckWarning::DisableRegistrationAfterMigration);
138138
}
139-
if synapse_config.user_consent {
139+
if synapse_config.user_consent.is_some() {
140140
warnings.push(CheckWarning::DisableUserConsentAfterMigration);
141141
}
142142

@@ -232,7 +232,7 @@ pub async fn synapse_config_check_against_mas_config(
232232
}
233233

234234
let mas_branding = BrandingConfig::extract_or_default(mas)?;
235-
if synapse.user_consent && mas_branding.tos_uri.is_none() {
235+
if synapse.user_consent.is_some() && mas_branding.tos_uri.is_none() {
236236
warnings.push(CheckWarning::ShouldPortUserConsentAsTerms);
237237
}
238238

crates/syn2mas/src/synapse_reader/config.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ use sqlx::postgres::PgConnectOptions;
1919
#[allow(clippy::struct_excessive_bools)]
2020
pub struct Config {
2121
pub database: DatabaseSection,
22+
23+
#[serde(default)]
2224
pub password_config: PasswordSection,
2325

2426
#[serde(default)]
@@ -36,7 +38,7 @@ pub struct Config {
3638
pub enable_3pid_changes: bool,
3739

3840
#[serde(default)]
39-
pub user_consent: bool,
41+
pub user_consent: Option<UserConsentSection>,
4042

4143
#[serde(default)]
4244
pub registrations_require_3pid: Vec<String>,
@@ -297,3 +299,8 @@ mod test {
297299
);
298300
}
299301
}
302+
303+
/// We don't care about any of the fields in this section,
304+
/// just whether it's present.
305+
#[derive(Deserialize)]
306+
pub struct UserConsentSection {}

0 commit comments

Comments
 (0)