Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit e70c6b7

Browse files
authored
Disable pushing for server ACL events (MSC3786). (#13997)
Switches to the stable identifier for MSC3786 and enables it by default. This disables pushes of m.room.server_acl events.
1 parent 27fa0fa commit e70c6b7

File tree

6 files changed

+5
-25
lines changed

6 files changed

+5
-25
lines changed

changelog.d/13997.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ignore server ACL changes when generating pushes. Implement [MSC3786](https://github.com/matrix-org/matrix-spec-proposals/pull/3786).

rust/src/push/base_rules.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ pub const BASE_APPEND_OVERRIDE_RULES: &[PushRule] = &[
173173
default_enabled: true,
174174
},
175175
PushRule {
176-
rule_id: Cow::Borrowed("global/override/.org.matrix.msc3786.rule.room.server_acl"),
176+
rule_id: Cow::Borrowed("global/override/.m.rule.room.server_acl"),
177177
priority_class: 5,
178178
conditions: Cow::Borrowed(&[
179179
Condition::Known(KnownCondition::EventMatch(EventMatchCondition {

rust/src/push/mod.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ impl PushRules {
401401
pub struct FilteredPushRules {
402402
push_rules: PushRules,
403403
enabled_map: BTreeMap<String, bool>,
404-
msc3786_enabled: bool,
405404
msc3772_enabled: bool,
406405
}
407406

@@ -411,13 +410,11 @@ impl FilteredPushRules {
411410
pub fn py_new(
412411
push_rules: PushRules,
413412
enabled_map: BTreeMap<String, bool>,
414-
msc3786_enabled: bool,
415413
msc3772_enabled: bool,
416414
) -> Self {
417415
Self {
418416
push_rules,
419417
enabled_map,
420-
msc3786_enabled,
421418
msc3772_enabled,
422419
}
423420
}
@@ -437,12 +434,6 @@ impl FilteredPushRules {
437434
.iter()
438435
.filter(|rule| {
439436
// Ignore disabled experimental push rules
440-
if !self.msc3786_enabled
441-
&& rule.rule_id == "global/override/.org.matrix.msc3786.rule.room.server_acl"
442-
{
443-
return false;
444-
}
445-
446437
if !self.msc3772_enabled
447438
&& rule.rule_id == "global/underride/.org.matrix.msc3772.thread_reply"
448439
{

stubs/synapse/synapse_rust/push.pyi

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ class PushRules:
2626

2727
class FilteredPushRules:
2828
def __init__(
29-
self,
30-
push_rules: PushRules,
31-
enabled_map: Dict[str, bool],
32-
msc3786_enabled: bool,
33-
msc3772_enabled: bool,
29+
self, push_rules: PushRules, enabled_map: Dict[str, bool], msc3772_enabled: bool
3430
): ...
3531
def rules(self) -> Collection[Tuple[PushRule, bool]]: ...
3632

synapse/config/experimental.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ def read_config(self, config: JsonDict, **kwargs: Any) -> None:
9595
# MSC2815 (allow room moderators to view redacted event content)
9696
self.msc2815_enabled: bool = experimental.get("msc2815_enabled", False)
9797

98-
# MSC3786 (Add a default push rule to ignore m.room.server_acl events)
99-
self.msc3786_enabled: bool = experimental.get("msc3786_enabled", False)
100-
10198
# MSC3771: Thread read receipts
10299
self.msc3771_enabled: bool = experimental.get("msc3771_enabled", False)
103100
# MSC3772: A push rule for mutual relations.

synapse/storage/databases/main/push_rule.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,10 @@ def _load_rules(
8181
for rawrule in rawrules
8282
]
8383

84-
push_rules = PushRules(
85-
ruleslist,
86-
)
84+
push_rules = PushRules(ruleslist)
8785

8886
filtered_rules = FilteredPushRules(
89-
push_rules,
90-
enabled_map,
91-
msc3786_enabled=experimental_config.msc3786_enabled,
92-
msc3772_enabled=experimental_config.msc3772_enabled,
87+
push_rules, enabled_map, msc3772_enabled=experimental_config.msc3772_enabled
9388
)
9489

9590
return filtered_rules

0 commit comments

Comments
 (0)