summary refs log tree commit diff
path: root/rust/src/push/mod.rs
diff options
context:
space:
mode:
authorTravis Ralston <travisr@matrix.org>2022-11-28 18:02:41 -0700
committerGitHub <noreply@github.com>2022-11-28 18:02:41 -0700
commit9ccc09fe9e332a71b8cf5bf42b16f6acf5a6887d (patch)
tree2fd03d66046efdd5592ea77bfc27b119e7a52705 /rust/src/push/mod.rs
parentCreate MSC1767 (extensible events) room version; Implement MSC3932 (#14521) (diff)
downloadsynapse-9ccc09fe9e332a71b8cf5bf42b16f6acf5a6887d.tar.xz
Support MSC1767's `content.body` behaviour; Add base rules from MSC3933 (#14524)
* Support MSC1767's `content.body` behaviour in push rules

* Add the base rules from MSC3933

* Changelog entry

* Flip condition around for finding `m.markup`

* Remove forgotten import
Diffstat (limited to 'rust/src/push/mod.rs')
-rw-r--r--rust/src/push/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/rust/src/push/mod.rs b/rust/src/push/mod.rs
index eef39f6472..2e9d3e38a1 100644
--- a/rust/src/push/mod.rs
+++ b/rust/src/push/mod.rs
@@ -412,6 +412,7 @@ pub struct FilteredPushRules {
     push_rules: PushRules,
     enabled_map: BTreeMap<String, bool>,
     msc3664_enabled: bool,
+    msc1767_enabled: bool,
 }
 
 #[pymethods]
@@ -421,11 +422,13 @@ impl FilteredPushRules {
         push_rules: PushRules,
         enabled_map: BTreeMap<String, bool>,
         msc3664_enabled: bool,
+        msc1767_enabled: bool,
     ) -> Self {
         Self {
             push_rules,
             enabled_map,
             msc3664_enabled,
+            msc1767_enabled,
         }
     }
 
@@ -450,6 +453,10 @@ impl FilteredPushRules {
                     return false;
                 }
 
+                if !self.msc1767_enabled && rule.rule_id.contains("org.matrix.msc1767") {
+                    return false;
+                }
+
                 true
             })
             .map(|r| {