mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-04 18:08:48 -04:00
Update intentional mentions (MSC3952) to depend on exact_event_property_contains
(MSC3966). (#15051)
This replaces the specific `is_user_mention` push rule condition used in MSC3952 with the generic `exact_event_property_contains` push rule condition from MSC3966.
This commit is contained in:
parent
33a85cf08c
commit
8ef324ea6f
11 changed files with 73 additions and 94 deletions
|
@ -41,11 +41,12 @@ def format_push_rules_for_user(
|
|||
|
||||
rulearray.append(template_rule)
|
||||
|
||||
pattern_type = template_rule.pop("pattern_type", None)
|
||||
if pattern_type == "user_id":
|
||||
template_rule["pattern"] = user.to_string()
|
||||
elif pattern_type == "user_localpart":
|
||||
template_rule["pattern"] = user.localpart
|
||||
for type_key in ("pattern", "value"):
|
||||
type_value = template_rule.pop(f"{type_key}_type", None)
|
||||
if type_value == "user_id":
|
||||
template_rule[type_key] = user.to_string()
|
||||
elif type_value == "user_localpart":
|
||||
template_rule[type_key] = user.localpart
|
||||
|
||||
template_rule["enabled"] = enabled
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue