Skip to content

Commit 643558d

Browse files
committed
Skip legacy rule processing if mentions exist.
1 parent 4dc4e5c commit 643558d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/pushprocessor.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,16 @@ export class PushProcessor {
712712
}
713713

714714
public ruleMatchesEvent(rule: Partial<IPushRule> & Pick<IPushRule, "conditions">, ev: MatrixEvent): boolean {
715+
// Disable the deprecated mentions push rules if the new mentions property exists.
716+
if (
717+
ev.getContent()["org.matrix.msc3952.mentions"] !== undefined &&
718+
(rule.rule_id === RuleId.ContainsUserName ||
719+
rule.rule_id === RuleId.ContainsDisplayName ||
720+
rule.rule_id === RuleId.AtRoomNotification)
721+
) {
722+
return false;
723+
}
724+
715725
return !rule.conditions?.some((cond) => !this.eventFulfillsCondition(cond, ev));
716726
}
717727

0 commit comments

Comments
 (0)