Merge branch 'matthew/lls-beacon-push-rules' into matthew/knock-push-rules

# Conflicts:
#	rust/src/push/mod.rs
#	synapse/storage/databases/main/push_rule.py
#	synapse/synapse_rust/push.pyi
This commit is contained in:
Matthew Hodgson
2026-07-14 12:50:44 +01:00
5 changed files with 30 additions and 15 deletions
+18 -2
View File
@@ -297,6 +297,22 @@ pub const BASE_APPEND_OVERRIDE_RULES: &[PushRule] = &[
default: true,
default_enabled: true,
},
// MSC4505: explicitly suppress live location share beacon updates in unencrypted
// rooms (in encrypted rooms they arrive as m.room.encrypted and can only be
// suppressed client-side after decryption).
PushRule {
rule_id: Cow::Borrowed("global/override/.org.matrix.msc4505.rule.beacon"),
priority_class: 5,
conditions: Cow::Borrowed(&[Condition::Known(KnownCondition::EventMatch(
EventMatchCondition {
key: Cow::Borrowed("type"),
pattern: Cow::Borrowed("org.matrix.msc3672.beacon"),
},
))]),
actions: Cow::Borrowed(&[]),
default: true,
default_enabled: true,
},
];
pub const BASE_APPEND_CONTENT_RULES: &[PushRule] = &[PushRule {
@@ -746,7 +762,7 @@ pub const BASE_APPEND_UNDERRIDE_RULES: &[PushRule] = &[
default_enabled: true,
},
PushRule {
rule_id: Cow::Borrowed("global/underride/.io.element.rule.beacon_info_one_to_one"),
rule_id: Cow::Borrowed("global/underride/.org.matrix.msc4505.rule.beacon_info_one_to_one"),
priority_class: 1,
conditions: Cow::Borrowed(&[
Condition::Known(KnownCondition::RoomMemberCount {
@@ -766,7 +782,7 @@ pub const BASE_APPEND_UNDERRIDE_RULES: &[PushRule] = &[
default_enabled: true,
},
PushRule {
rule_id: Cow::Borrowed("global/underride/.io.element.rule.beacon_info"),
rule_id: Cow::Borrowed("global/underride/.org.matrix.msc4505.rule.beacon_info"),
priority_class: 1,
conditions: Cow::Borrowed(&[
Condition::Known(KnownCondition::EventMatch(EventMatchCondition {
+5 -5
View File
@@ -566,7 +566,7 @@ pub struct FilteredPushRules {
msc4028_push_encrypted_events: bool,
msc4210_enabled: bool,
msc4306_enabled: bool,
mscxxxx_beacon_push_rules_enabled: bool,
msc4505_enabled: bool,
mscxxxx_knock_push_rule_enabled: bool,
}
@@ -583,7 +583,7 @@ impl FilteredPushRules {
msc4028_push_encrypted_events: bool,
msc4210_enabled: bool,
msc4306_enabled: bool,
mscxxxx_beacon_push_rules_enabled: bool,
msc4505_enabled: bool,
mscxxxx_knock_push_rule_enabled: bool,
) -> Self {
Self {
@@ -595,7 +595,7 @@ impl FilteredPushRules {
msc4028_push_encrypted_events,
msc4210_enabled,
msc4306_enabled,
mscxxxx_beacon_push_rules_enabled,
msc4505_enabled,
mscxxxx_knock_push_rule_enabled,
}
}
@@ -633,8 +633,8 @@ impl FilteredPushRules {
return false;
}
if !self.mscxxxx_beacon_push_rules_enabled
&& rule.rule_id.contains("/.io.element.rule.beacon_info")
if !self.msc4505_enabled
&& rule.rule_id.contains("/.org.matrix.msc4505.rule.beacon")
{
return false;
}
+5 -6
View File
@@ -156,12 +156,11 @@ class ExperimentalConfig(Config):
"msc3381_polls_enabled", False
)
# MSCXXXX (unnumbered draft): default push rules for live location share
# beacon_info start events (the MSC3672 state event). Unstable rule ids:
# .io.element.rule.beacon_info(_one_to_one).
self.mscxxxx_beacon_push_rules_enabled: bool = experimental.get(
"mscxxxx_beacon_push_rules_enabled", False
)
# MSC4505: default push rules for live location sharing — notify on
# beacon_info start events (the MSC3672 state event), suppress beacon
# updates. Unstable rule ids: .org.matrix.msc4505.rule.beacon_info
# (_one_to_one) / .org.matrix.msc4505.rule.beacon.
self.msc4505_enabled: bool = experimental.get("msc4505_enabled", False)
# MSCXXXX (unnumbered draft): default push rule notifying room members
# who can act on a knock (MSC2403), via the new `recipient_permission`
+1 -1
View File
@@ -107,7 +107,7 @@ def _load_rules(
msc4028_push_encrypted_events=experimental_config.msc4028_push_encrypted_events,
msc4210_enabled=experimental_config.msc4210_enabled,
msc4306_enabled=experimental_config.msc4306_enabled,
mscxxxx_beacon_push_rules_enabled=experimental_config.mscxxxx_beacon_push_rules_enabled,
msc4505_enabled=experimental_config.msc4505_enabled,
mscxxxx_knock_push_rule_enabled=experimental_config.mscxxxx_knock_push_rule_enabled,
)
+1 -1
View File
@@ -50,7 +50,7 @@ class FilteredPushRules:
msc4028_push_encrypted_events: bool,
msc4210_enabled: bool,
msc4306_enabled: bool,
mscxxxx_beacon_push_rules_enabled: bool,
msc4505_enabled: bool,
mscxxxx_knock_push_rule_enabled: bool,
): ...
def rules(self) -> Collection[tuple[PushRule, bool]]: ...