Skip to content

Commit 0f479d0

Browse files
committed
syn2mas: fix handling of Synapse user_consent config
Closes #3928
1 parent 1410385 commit 0f479d0

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

crates/syn2mas/src/synapse_reader/checks.rs

+2-2
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

+6-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub struct Config {
3636
pub enable_3pid_changes: bool,
3737

3838
#[serde(default)]
39-
pub user_consent: bool,
39+
pub user_consent: Option<UserConsentSection>,
4040

4141
#[serde(default)]
4242
pub registrations_require_3pid: Vec<String>,
@@ -297,3 +297,8 @@ mod test {
297297
);
298298
}
299299
}
300+
301+
/// We don't care about any of the fields in this section,
302+
/// just whether it's present.
303+
#[derive(Deserialize)]
304+
pub struct UserConsentSection {}

0 commit comments

Comments
 (0)