From 11bc9a1b3ae21bd2041bf7cc4b93dd70a8c3b93e Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 14 Oct 2024 15:24:28 +0200 Subject: Implement MSC4210: Remove legacy mentions (#17783) --- rust/src/push/mod.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'rust/src/push/mod.rs') diff --git a/rust/src/push/mod.rs b/rust/src/push/mod.rs index 2a452b69a3..ef8ed150d4 100644 --- a/rust/src/push/mod.rs +++ b/rust/src/push/mod.rs @@ -534,6 +534,7 @@ pub struct FilteredPushRules { msc3381_polls_enabled: bool, msc3664_enabled: bool, msc4028_push_encrypted_events: bool, + msc4210_enabled: bool, } #[pymethods] @@ -546,6 +547,7 @@ impl FilteredPushRules { msc3381_polls_enabled: bool, msc3664_enabled: bool, msc4028_push_encrypted_events: bool, + msc4210_enabled: bool, ) -> Self { Self { push_rules, @@ -554,6 +556,7 @@ impl FilteredPushRules { msc3381_polls_enabled, msc3664_enabled, msc4028_push_encrypted_events, + msc4210_enabled, } } @@ -596,6 +599,14 @@ impl FilteredPushRules { return false; } + if self.msc4210_enabled + && (rule.rule_id == "global/override/.m.rule.contains_display_name" + || rule.rule_id == "global/content/.m.rule.contains_user_name" + || rule.rule_id == "global/override/.m.rule.roomnotif") + { + return false; + } + true }) .map(|r| { -- cgit 1.5.1