diff --git a/spec/unit/pushprocessor.spec.ts b/spec/unit/pushprocessor.spec.ts index c381c5e64..9aae1eefd 100644 --- a/spec/unit/pushprocessor.spec.ts +++ b/spec/unit/pushprocessor.spec.ts @@ -657,7 +657,7 @@ describe("NotificationService", function () { content: { "body": "", "msgtype": "m.text", - "org.matrix.msc3952.mentions": {}, + "m.mentions": {}, }, }); diff --git a/src/@types/PushRules.ts b/src/@types/PushRules.ts index da3b01b6d..6aebaa617 100644 --- a/src/@types/PushRules.ts +++ b/src/@types/PushRules.ts @@ -137,8 +137,8 @@ export enum PushRuleKind { export enum RuleId { Master = ".m.rule.master", - IsUserMention = ".org.matrix.msc3952.is_user_mention", - IsRoomMention = ".org.matrix.msc3952.is_room_mention", + IsUserMention = ".m.rule.is_user_mention", + IsRoomMention = ".m.rule.is_room_mention", ContainsDisplayName = ".m.rule.contains_display_name", ContainsUserName = ".m.rule.contains_user_name", AtRoomNotification = ".m.rule.roomnotif", diff --git a/src/feature.ts b/src/feature.ts index c0d7a341a..01cadd8e8 100644 --- a/src/feature.ts +++ b/src/feature.ts @@ -63,6 +63,7 @@ const featureSupportResolver: Record = { }, [Feature.IntentionalMentions]: { unstablePrefixes: ["org.matrix.msc3952_intentional_mentions"], + matrixVersion: "v1.7", }, }; diff --git a/src/models/event.ts b/src/models/event.ts index 3ed1957f4..72c6212db 100644 --- a/src/models/event.ts +++ b/src/models/event.ts @@ -57,7 +57,7 @@ export interface IContent { "displayname"?: string; "m.relates_to"?: IEventRelation; - "org.matrix.msc3952.mentions"?: IMentions; + "m.mentions"?: IMentions; } type StrippedState = Required>; diff --git a/src/pushprocessor.ts b/src/pushprocessor.ts index 10dd7f6ba..7e63162b4 100644 --- a/src/pushprocessor.ts +++ b/src/pushprocessor.ts @@ -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)