mirror of
https://github.com/element-hq/synapse.git
synced 2026-08-29 07:48:20 +00:00
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:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user