mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-12 16:12:10 -04:00
Update intentional mentions (MSC3952) to depend on exact_event_match
(MSC3758). (#15037)
This replaces the specific `is_room_mention` push rule condition used in MSC3952 with the generic `exact_event_match` push rule condition from MSC3758. No functionality changes due to this.
This commit is contained in:
parent
d1efc47925
commit
979f237b28
10 changed files with 26 additions and 59 deletions
|
@ -400,7 +400,6 @@ class BulkPushRuleEvaluator:
|
|||
mentions = event.content.get(EventContentFields.MSC3952_MENTIONS)
|
||||
has_mentions = self._intentional_mentions_enabled and isinstance(mentions, dict)
|
||||
user_mentions: Set[str] = set()
|
||||
room_mention = False
|
||||
if has_mentions:
|
||||
# mypy seems to have lost the type even though it must be a dict here.
|
||||
assert isinstance(mentions, dict)
|
||||
|
@ -410,8 +409,6 @@ class BulkPushRuleEvaluator:
|
|||
user_mentions = set(
|
||||
filter(lambda item: isinstance(item, str), user_mentions_raw)
|
||||
)
|
||||
# Room mention is only true if the value is exactly true.
|
||||
room_mention = mentions.get("room") is True
|
||||
|
||||
evaluator = PushRuleEvaluator(
|
||||
_flatten_dict(
|
||||
|
@ -420,7 +417,6 @@ class BulkPushRuleEvaluator:
|
|||
),
|
||||
has_mentions,
|
||||
user_mentions,
|
||||
room_mention,
|
||||
room_member_count,
|
||||
sender_power_level,
|
||||
notification_levels,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue