1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-23 17:02:25 +03:00

Stabilize support for MSC3952: intentional mentions (#3397)

* use stable identifiers for MSC3952: intentional mentions

* add matrix version to feature support for intentional mentions
This commit is contained in:
Kerry
2023-07-12 10:04:06 +12:00
committed by GitHub
parent dcf26f3e48
commit 3b88ea19b7
5 changed files with 8 additions and 7 deletions

View File

@@ -78,7 +78,7 @@ const DEFAULT_OVERRIDE_RULES: IPushRule[] = [
conditions: [
{
kind: ConditionKind.EventPropertyContains,
key: "content.org\\.matrix\\.msc3952\\.mentions.user_ids",
key: "content.m\\.mentions.user_ids",
value: "", // The user ID is dynamically added in rewriteDefaultRules.
},
],
@@ -91,7 +91,7 @@ const DEFAULT_OVERRIDE_RULES: IPushRule[] = [
conditions: [
{
kind: ConditionKind.EventPropertyIs,
key: "content.org\\.matrix\\.msc3952\\.mentions.room",
key: "content.m\\.mentions.room",
value: true,
},
{
@@ -724,7 +724,7 @@ export class PushProcessor {
// Disable the deprecated mentions push rules if the new mentions property exists.
if (
this.client.supportsIntentionalMentions() &&
ev.getContent()["org.matrix.msc3952.mentions"] !== undefined &&
ev.getContent()["m.mentions"] !== undefined &&
(rule.rule_id === RuleId.ContainsUserName ||
rule.rule_id === RuleId.ContainsDisplayName ||
rule.rule_id === RuleId.AtRoomNotification)