From 573c6ee9b9b23c39f86abd9bceee4ea4ed19547b Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Tue, 23 May 2023 15:50:17 +1200 Subject: [PATCH 1/7] enable feature_intentional_mentions with v1.7 --- src/settings/Settings.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx index 41774bb63c0..05c3809dfcf 100644 --- a/src/settings/Settings.tsx +++ b/src/settings/Settings.tsx @@ -529,9 +529,12 @@ export const SETTINGS: { [setting: string]: ISetting } = { displayName: _td("Enable intentional mentions"), labsGroup: LabGroup.Rooms, default: false, - controller: new ServerSupportUnstableFeatureController("feature_intentional_mentions", defaultWatchManager, [ - ["org.matrix.msc3952_intentional_mentions"], - ]), + controller: new ServerSupportUnstableFeatureController( + "feature_intentional_mentions", + defaultWatchManager, + [["org.matrix.msc3952_intentional_mentions"]], + "v1.7" + ), }, "useCompactLayout": { supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS, From 95f9fdfe19308995375c314439d0d73730557691 Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Tue, 23 May 2023 16:08:11 +1200 Subject: [PATCH 2/7] org.matrix.msc3952.mentions -> m.mentions --- .../views/rooms/SendMessageComposer.tsx | 8 +-- test/ContentMessages-test.ts | 2 +- .../views/rooms/EditMessageComposer-test.tsx | 44 +++++++------- .../views/rooms/SendMessageComposer-test.tsx | 58 +++++++++---------- .../rooms/VoiceRecordComposerTile-test.tsx | 4 +- 5 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/components/views/rooms/SendMessageComposer.tsx b/src/components/views/rooms/SendMessageComposer.tsx index 0789c419052..e348211e119 100644 --- a/src/components/views/rooms/SendMessageComposer.tsx +++ b/src/components/views/rooms/SendMessageComposer.tsx @@ -88,7 +88,7 @@ export function attachMentions( } // The mentions property *always* gets included to disable legacy push rules. - const mentions: IMentions = (content["org.matrix.msc3952.mentions"] = {}); + const mentions: IMentions = (content["m.mentions"] = {}); const userMentions = new Set(); let roomMention = false; @@ -99,7 +99,7 @@ export function attachMentions( userMentions.add(replyToEvent.sender!.userId); // TODO What do we do if the reply event *doeesn't* have this property? // Try to fish out replies from the contents? - const userIds = replyToEvent.getContent()["org.matrix.msc3952.mentions"]?.user_ids; + const userIds = replyToEvent.getContent()["m.mentions"]?.user_ids; if (Array.isArray(userIds)) { userIds.forEach((userId) => userMentions.add(userId)); } @@ -126,7 +126,7 @@ export function attachMentions( if (editedContent) { // First, the new event content gets the *full* set of users. const newContent = content["m.new_content"]; - const newMentions: IMentions = (newContent["org.matrix.msc3952.mentions"] = {}); + const newMentions: IMentions = (newContent["m.mentions"] = {}); // Only include the users/room if there is any content. if (userMentions.size) { @@ -138,7 +138,7 @@ export function attachMentions( // Fetch the mentions from the original event and remove any previously // mentioned users. - const prevMentions = editedContent["org.matrix.msc3952.mentions"]; + const prevMentions = editedContent["m.mentions"]; if (Array.isArray(prevMentions?.user_ids)) { prevMentions!.user_ids.forEach((userId) => userMentions.delete(userId)); } diff --git a/test/ContentMessages-test.ts b/test/ContentMessages-test.ts index e725d4d9ce2..64bd3c845cc 100644 --- a/test/ContentMessages-test.ts +++ b/test/ContentMessages-test.ts @@ -245,7 +245,7 @@ describe("ContentMessages", () => { expect.objectContaining({ "url": "mxc://server/file", "msgtype": "m.image", - "org.matrix.msc3952.mentions": { + "m.mentions": { user_ids: ["@bob:test"], }, }), diff --git a/test/components/views/rooms/EditMessageComposer-test.tsx b/test/components/views/rooms/EditMessageComposer-test.tsx index 478830e3ba0..0eb617c7dcc 100644 --- a/test/components/views/rooms/EditMessageComposer-test.tsx +++ b/test/components/views/rooms/EditMessageComposer-test.tsx @@ -69,7 +69,7 @@ describe("", () => { "format": "org.matrix.custom.html", "formatted_body": 'hey Bob and Charlie', - "org.matrix.msc3952.mentions": { + "m.mentions": { user_ids: ["@bob:server.org", "@charlie:server.org"], }, }, @@ -301,8 +301,8 @@ describe("", () => { const messageContent = mockClient.sendMessage.mock.calls[0][2]; // both content.mentions and new_content.mentions are empty - expect(messageContent["org.matrix.msc3952.mentions"]).toEqual({}); - expect(messageContent["m.new_content"]["org.matrix.msc3952.mentions"]).toEqual({}); + expect(messageContent["m.mentions"]).toEqual({}); + expect(messageContent["m.new_content"]["m.mentions"]).toEqual({}); }); it("should retain mentions in the original message that are not removed by the edit", async () => { @@ -317,9 +317,9 @@ describe("", () => { const messageContent = mockClient.sendMessage.mock.calls[0][2]; // no new mentions were added, so nothing in top level mentions - expect(messageContent["org.matrix.msc3952.mentions"]).toEqual({}); + expect(messageContent["m.mentions"]).toEqual({}); // bob is still mentioned, charlie removed - expect(messageContent["m.new_content"]["org.matrix.msc3952.mentions"]).toEqual({ + expect(messageContent["m.new_content"]["m.mentions"]).toEqual({ user_ids: ["@bob:server.org"], }); }); @@ -336,9 +336,9 @@ describe("", () => { const messageContent = mockClient.sendMessage.mock.calls[0][2]; // no new mentions were added, so nothing in top level mentions - expect(messageContent["org.matrix.msc3952.mentions"]).toEqual({}); + expect(messageContent["m.mentions"]).toEqual({}); // bob is not longer mentioned in the edited message, so empty mentions in new_content - expect(messageContent["m.new_content"]["org.matrix.msc3952.mentions"]).toEqual({}); + expect(messageContent["m.new_content"]["m.mentions"]).toEqual({}); }); it("should add mentions that were added in the edit", async () => { @@ -355,10 +355,10 @@ describe("", () => { const messageContent = mockClient.sendMessage.mock.calls[0][2]; // new mention in the edit - expect(messageContent["org.matrix.msc3952.mentions"]).toEqual({ + expect(messageContent["m.mentions"]).toEqual({ user_ids: ["@dan:server.org"], }); - expect(messageContent["m.new_content"]["org.matrix.msc3952.mentions"]).toEqual({ + expect(messageContent["m.new_content"]["m.mentions"]).toEqual({ user_ids: ["@dan:server.org"], }); }); @@ -378,11 +378,11 @@ describe("", () => { const messageContent = mockClient.sendMessage.mock.calls[0][2]; // new mention in the edit - expect(messageContent["org.matrix.msc3952.mentions"]).toEqual({ + expect(messageContent["m.mentions"]).toEqual({ user_ids: ["@dan:server.org"], }); // all mentions in the edited version of the event - expect(messageContent["m.new_content"]["org.matrix.msc3952.mentions"]).toEqual({ + expect(messageContent["m.new_content"]["m.mentions"]).toEqual({ user_ids: ["@bob:server.org", "@dan:server.org"], }); }); @@ -409,7 +409,7 @@ describe("", () => { event_id: originalEvent.getId(), }, }, - "org.matrix.msc3952.mentions": { + "m.mentions": { user_ids: [originalEvent.getSender()!], }, }, @@ -428,7 +428,7 @@ describe("", () => { event_id: originalEvent.getId(), }, }, - "org.matrix.msc3952.mentions": { + "m.mentions": { user_ids: [ // sender of event we replied to originalEvent.getSender()!, @@ -455,9 +455,9 @@ describe("", () => { const messageContent = mockClient.sendMessage.mock.calls[0][2]; // no new mentions from edit - expect(messageContent["org.matrix.msc3952.mentions"]).toEqual({}); + expect(messageContent["m.mentions"]).toEqual({}); // edited reply still mentions the parent event sender - expect(messageContent["m.new_content"]["org.matrix.msc3952.mentions"]).toEqual({ + expect(messageContent["m.new_content"]["m.mentions"]).toEqual({ user_ids: [originalEvent.getSender()], }); }); @@ -474,12 +474,12 @@ describe("", () => { const messageContent = mockClient.sendMessage.mock.calls[0][2]; // new mention in edit - expect(messageContent["org.matrix.msc3952.mentions"]).toEqual({ + expect(messageContent["m.mentions"]).toEqual({ user_ids: ["@dan:server.org"], }); // edited reply still mentions the parent event sender // plus new mention @dan - expect(messageContent["m.new_content"]["org.matrix.msc3952.mentions"]).toEqual({ + expect(messageContent["m.new_content"]["m.mentions"]).toEqual({ user_ids: [originalEvent.getSender(), "@dan:server.org"], }); }); @@ -495,10 +495,10 @@ describe("", () => { const messageContent = mockClient.sendMessage.mock.calls[0][2]; // no mentions in edit - expect(messageContent["org.matrix.msc3952.mentions"]).toEqual({}); + expect(messageContent["m.mentions"]).toEqual({}); // edited reply still mentions the parent event sender // existing @bob mention removed - expect(messageContent["m.new_content"]["org.matrix.msc3952.mentions"]).toEqual({ + expect(messageContent["m.new_content"]["m.mentions"]).toEqual({ user_ids: [originalEvent.getSender()], }); }); @@ -516,7 +516,7 @@ describe("", () => { event_id: originalEvent.getId(), }, }, - "org.matrix.msc3952.mentions": { + "m.mentions": { user_ids: [ // sender of event we replied to originalEvent.getSender()!, @@ -535,9 +535,9 @@ describe("", () => { const messageContent = mockClient.sendMessage.mock.calls[0][2]; // no mentions in edit - expect(messageContent["org.matrix.msc3952.mentions"]).toEqual({}); + expect(messageContent["m.mentions"]).toEqual({}); // edited reply still mentions the parent event sender - expect(messageContent["m.new_content"]["org.matrix.msc3952.mentions"]).toEqual({ + expect(messageContent["m.new_content"]["m.mentions"]).toEqual({ user_ids: [originalEvent.getSender()], }); }); diff --git a/test/components/views/rooms/SendMessageComposer-test.tsx b/test/components/views/rooms/SendMessageComposer-test.tsx index 0d392c97c2a..3228381b9c1 100644 --- a/test/components/views/rooms/SendMessageComposer-test.tsx +++ b/test/components/views/rooms/SendMessageComposer-test.tsx @@ -177,7 +177,7 @@ describe("", () => { const content: IContent = {}; attachMentions("@alice:test", content, model, undefined); expect(content).toEqual({ - "org.matrix.msc3952.mentions": {}, + "m.mentions": {}, }); }); @@ -186,7 +186,7 @@ describe("", () => { const content: IContent = {}; attachMentions("@alice:test", content, model, undefined); expect(content).toEqual({ - "org.matrix.msc3952.mentions": { user_ids: ["@bob:test"] }, + "m.mentions": { user_ids: ["@bob:test"] }, }); }); @@ -197,13 +197,13 @@ describe("", () => { type: "m.room.message", user: "@bob:test", room: "!abc:test", - content: { "org.matrix.msc3952.mentions": {} }, + content: { "m.mentions": {} }, event: true, }); let content: IContent = {}; attachMentions("@alice:test", content, model, replyToEvent); expect(content).toEqual({ - "org.matrix.msc3952.mentions": { user_ids: ["@bob:test"] }, + "m.mentions": { user_ids: ["@bob:test"] }, }); // It also adds any other mentioned users, but removes yourself. @@ -211,13 +211,13 @@ describe("", () => { type: "m.room.message", user: "@bob:test", room: "!abc:test", - content: { "org.matrix.msc3952.mentions": { user_ids: ["@alice:test", "@charlie:test"] } }, + content: { "m.mentions": { user_ids: ["@alice:test", "@charlie:test"] } }, event: true, }); content = {}; attachMentions("@alice:test", content, model, replyToEvent); expect(content).toEqual({ - "org.matrix.msc3952.mentions": { user_ids: ["@bob:test", "@charlie:test"] }, + "m.mentions": { user_ids: ["@bob:test", "@charlie:test"] }, }); }); @@ -226,7 +226,7 @@ describe("", () => { const content: IContent = {}; attachMentions("@alice:test", content, model, undefined); expect(content).toEqual({ - "org.matrix.msc3952.mentions": { room: true }, + "m.mentions": { room: true }, }); }); @@ -237,13 +237,13 @@ describe("", () => { type: "m.room.message", user: "@alice:test", room: "!abc:test", - content: { "org.matrix.msc3952.mentions": { room: true } }, + content: { "m.mentions": { room: true } }, event: true, }); const content: IContent = {}; attachMentions("@alice:test", content, model, replyToEvent); expect(content).toEqual({ - "org.matrix.msc3952.mentions": {}, + "m.mentions": {}, }); }); @@ -255,13 +255,13 @@ describe("", () => { user: "@alice:test", room: "!abc:test", // @ts-ignore - Purposefully testing invalid data. - content: { "org.matrix.msc3952.mentions": { user_ids: "@bob:test" } }, + content: { "m.mentions": { user_ids: "@bob:test" } }, event: true, }); const content: IContent = {}; attachMentions("@alice:test", content, model, replyToEvent); expect(content).toEqual({ - "org.matrix.msc3952.mentions": {}, + "m.mentions": {}, }); }); @@ -272,8 +272,8 @@ describe("", () => { const prevContent: IContent = {}; attachMentions("@alice:test", content, model, undefined, prevContent); expect(content).toEqual({ - "org.matrix.msc3952.mentions": {}, - "m.new_content": { "org.matrix.msc3952.mentions": {} }, + "m.mentions": {}, + "m.new_content": { "m.mentions": {} }, }); }); @@ -281,12 +281,12 @@ describe("", () => { const model = new EditorModel([], partsCreator); const content: IContent = { "m.new_content": {} }; const prevContent: IContent = { - "org.matrix.msc3952.mentions": { user_ids: ["@bob:test"], room: true }, + "m.mentions": { user_ids: ["@bob:test"], room: true }, }; attachMentions("@alice:test", content, model, undefined, prevContent); expect(content).toEqual({ - "org.matrix.msc3952.mentions": {}, - "m.new_content": { "org.matrix.msc3952.mentions": {} }, + "m.mentions": {}, + "m.new_content": { "m.mentions": {} }, }); }); @@ -296,19 +296,19 @@ describe("", () => { const prevContent: IContent = {}; attachMentions("@alice:test", content, model, undefined, prevContent); expect(content).toEqual({ - "org.matrix.msc3952.mentions": { user_ids: ["@bob:test"] }, - "m.new_content": { "org.matrix.msc3952.mentions": { user_ids: ["@bob:test"] } }, + "m.mentions": { user_ids: ["@bob:test"] }, + "m.new_content": { "m.mentions": { user_ids: ["@bob:test"] } }, }); }); it("test prev user mentions", () => { const model = new EditorModel([partsCreator.userPill("Bob", "@bob:test")], partsCreator); const content: IContent = { "m.new_content": {} }; - const prevContent: IContent = { "org.matrix.msc3952.mentions": { user_ids: ["@bob:test"] } }; + const prevContent: IContent = { "m.mentions": { user_ids: ["@bob:test"] } }; attachMentions("@alice:test", content, model, undefined, prevContent); expect(content).toEqual({ - "org.matrix.msc3952.mentions": {}, - "m.new_content": { "org.matrix.msc3952.mentions": { user_ids: ["@bob:test"] } }, + "m.mentions": {}, + "m.new_content": { "m.mentions": { user_ids: ["@bob:test"] } }, }); }); @@ -318,19 +318,19 @@ describe("", () => { const prevContent: IContent = {}; attachMentions("@alice:test", content, model, undefined, prevContent); expect(content).toEqual({ - "org.matrix.msc3952.mentions": { room: true }, - "m.new_content": { "org.matrix.msc3952.mentions": { room: true } }, + "m.mentions": { room: true }, + "m.new_content": { "m.mentions": { room: true } }, }); }); it("test prev room mention", () => { const model = new EditorModel([partsCreator.atRoomPill("@room")], partsCreator); const content: IContent = { "m.new_content": {} }; - const prevContent: IContent = { "org.matrix.msc3952.mentions": { room: true } }; + const prevContent: IContent = { "m.mentions": { room: true } }; attachMentions("@alice:test", content, model, undefined, prevContent); expect(content).toEqual({ - "org.matrix.msc3952.mentions": {}, - "m.new_content": { "org.matrix.msc3952.mentions": { room: true } }, + "m.mentions": {}, + "m.new_content": { "m.mentions": { room: true } }, }); }); @@ -339,11 +339,11 @@ describe("", () => { const model = new EditorModel([], partsCreator); const content: IContent = { "m.new_content": {} }; // @ts-ignore - Purposefully testing invalid data. - const prevContent: IContent = { "org.matrix.msc3952.mentions": { user_ids: "@bob:test" } }; + const prevContent: IContent = { "m.mentions": { user_ids: "@bob:test" } }; attachMentions("@alice:test", content, model, undefined, prevContent); expect(content).toEqual({ - "org.matrix.msc3952.mentions": {}, - "m.new_content": { "org.matrix.msc3952.mentions": {} }, + "m.mentions": {}, + "m.new_content": { "m.mentions": {} }, }); }); }); diff --git a/test/components/views/rooms/VoiceRecordComposerTile-test.tsx b/test/components/views/rooms/VoiceRecordComposerTile-test.tsx index eedf874117c..0acc0080c3f 100644 --- a/test/components/views/rooms/VoiceRecordComposerTile-test.tsx +++ b/test/components/views/rooms/VoiceRecordComposerTile-test.tsx @@ -134,7 +134,7 @@ describe("", () => { "org.matrix.msc1767.text": "Voice message", "org.matrix.msc3245.voice": {}, "url": "mxc://example.com/voice", - "org.matrix.msc3952.mentions": {}, + "m.mentions": {}, }); }); @@ -188,7 +188,7 @@ describe("", () => { event_id: replyToEvent.getId(), }, }, - "org.matrix.msc3952.mentions": { user_ids: ["@bob:test"] }, + "m.mentions": { user_ids: ["@bob:test"] }, }); }); }); From 4d374593a71301a8177815a05a94040911493e86 Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Tue, 23 May 2023 17:38:54 +1200 Subject: [PATCH 3/7] update push rules test util --- test/test-utils/pushRules.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/test-utils/pushRules.ts b/test/test-utils/pushRules.ts index cffc423d1c6..a50f7dd36d8 100644 --- a/test/test-utils/pushRules.ts +++ b/test/test-utils/pushRules.ts @@ -237,12 +237,12 @@ export const DEFAULT_PUSH_RULES: IPushRules = Object.freeze({ conditions: [ { kind: "event_property_contains", - key: "content.org\\.matrix\\.msc3952\\.mentions.user_ids", + key: "content.m\\.mentions.user_ids", value_type: "user_id", }, ], actions: ["notify", { set_tweak: "highlight" }, { set_tweak: "sound", value: "default" }], - rule_id: ".org.matrix.msc3952.is_user_mention", + rule_id: ".m.rule.is_user_mention", default: true, enabled: true, }, @@ -255,11 +255,11 @@ export const DEFAULT_PUSH_RULES: IPushRules = Object.freeze({ }, { conditions: [ - { kind: "event_property_is", key: "content.org\\.matrix\\.msc3952\\.mentions.room", value: true }, + { kind: "event_property_is", key: "content.m\\.mentions.room", value: true }, { kind: "sender_notification_permission", key: "room" }, ], actions: ["notify", { set_tweak: "highlight" }], - rule_id: ".org.matrix.msc3952.is_room_mention", + rule_id: ".m.rule.is_room_mention", default: true, enabled: true, }, From 2207edf56ff462e856866d9032e2d9538c288080 Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Tue, 23 May 2023 17:39:55 +1200 Subject: [PATCH 4/7] only support stable version 1.7 --- src/settings/Settings.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx index 05c3809dfcf..83ee6edcebb 100644 --- a/src/settings/Settings.tsx +++ b/src/settings/Settings.tsx @@ -532,7 +532,7 @@ export const SETTINGS: { [setting: string]: ISetting } = { controller: new ServerSupportUnstableFeatureController( "feature_intentional_mentions", defaultWatchManager, - [["org.matrix.msc3952_intentional_mentions"]], + [], "v1.7" ), }, From 99a838c0888ca94d0bcc4f19fef6d6cdd48ede2a Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Tue, 4 Jul 2023 10:29:35 +1200 Subject: [PATCH 5/7] use stable values for msc3952 push rules --- src/settings/Settings.tsx | 2 +- .../notificationsettings/pushrules_bug_botnotices.json | 8 ++++---- test/models/notificationsettings/pushrules_default.json | 8 ++++---- .../notificationsettings/pushrules_default_new.json | 8 ++++---- test/models/notificationsettings/pushrules_sample.json | 8 ++++---- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx index 1c4b4110b8e..0a0429e2e69 100644 --- a/src/settings/Settings.tsx +++ b/src/settings/Settings.tsx @@ -547,7 +547,7 @@ export const SETTINGS: { [setting: string]: ISetting } = { "feature_intentional_mentions", defaultWatchManager, [], - "v1.7" + "v1.7", ), }, "useCompactLayout": { diff --git a/test/models/notificationsettings/pushrules_bug_botnotices.json b/test/models/notificationsettings/pushrules_bug_botnotices.json index 7956afb99c7..6ae0350140a 100644 --- a/test/models/notificationsettings/pushrules_bug_botnotices.json +++ b/test/models/notificationsettings/pushrules_bug_botnotices.json @@ -345,13 +345,13 @@ "enabled": true }, { - "rule_id": ".org.matrix.msc3952.is_user_mention", + "rule_id": ".m.rule.is_user_mention", "default": true, "enabled": true, "conditions": [ { "kind": "event_property_contains", - "key": "content.org\\.matrix\\.msc3952\\.mentions.user_ids", + "key": "content.m\\.mentions.user_ids", "value": "@jannemk:element.io" } ], @@ -363,13 +363,13 @@ ] }, { - "rule_id": ".org.matrix.msc3952.is_room_mention", + "rule_id": ".m.rule.is_room_mention", "default": true, "enabled": true, "conditions": [ { "kind": "event_property_is", - "key": "content.org\\.matrix\\.msc3952\\.mentions.room", + "key": "content.m\\.mentions.room", "value": true }, { diff --git a/test/models/notificationsettings/pushrules_default.json b/test/models/notificationsettings/pushrules_default.json index 1f6252410a1..a50531a99de 100644 --- a/test/models/notificationsettings/pushrules_default.json +++ b/test/models/notificationsettings/pushrules_default.json @@ -259,7 +259,7 @@ "conditions": [ { "kind": "event_property_contains", - "key": "content.org\\.matrix\\.msc3952\\.mentions.user_ids", + "key": "content.m\\.mentions.user_ids", "value": "@jannetestuser:beta.matrix.org" } ], @@ -269,7 +269,7 @@ "set_tweak": "highlight" } ], - "rule_id": ".org.matrix.msc3952.is_user_mention", + "rule_id": ".m.rule.is_user_mention", "default": true, "enabled": true, "kind": "override" @@ -299,7 +299,7 @@ "conditions": [ { "kind": "event_property_is", - "key": "content.org\\.matrix\\.msc3952\\.mentions.room", + "key": "content.m\\.mentions.room", "value": true }, { @@ -313,7 +313,7 @@ "set_tweak": "highlight" } ], - "rule_id": ".org.matrix.msc3952.is_room_mention", + "rule_id": ".m.rule.is_room_mention", "default": true, "enabled": true, "kind": "override" diff --git a/test/models/notificationsettings/pushrules_default_new.json b/test/models/notificationsettings/pushrules_default_new.json index 379e2d222dc..c405f41fa33 100644 --- a/test/models/notificationsettings/pushrules_default_new.json +++ b/test/models/notificationsettings/pushrules_default_new.json @@ -265,7 +265,7 @@ "conditions": [ { "kind": "event_property_contains", - "key": "content.org\\.matrix\\.msc3952\\.mentions.user_ids", + "key": "content.m\\.mentions.user_ids", "value": "@jannetestuser:beta.matrix.org" } ], @@ -275,7 +275,7 @@ "set_tweak": "highlight" } ], - "rule_id": ".org.matrix.msc3952.is_user_mention", + "rule_id": ".m.rule.is_user_mention", "default": true, "enabled": true, "kind": "override" @@ -305,7 +305,7 @@ "conditions": [ { "kind": "event_property_is", - "key": "content.org\\.matrix\\.msc3952\\.mentions.room", + "key": "content.m\\.mentions.room", "value": true }, { @@ -319,7 +319,7 @@ "set_tweak": "highlight" } ], - "rule_id": ".org.matrix.msc3952.is_room_mention", + "rule_id": ".m.rule.is_room_mention", "default": true, "enabled": true, "kind": "override" diff --git a/test/models/notificationsettings/pushrules_sample.json b/test/models/notificationsettings/pushrules_sample.json index 2c9f4b2af7b..7c8819e2b07 100644 --- a/test/models/notificationsettings/pushrules_sample.json +++ b/test/models/notificationsettings/pushrules_sample.json @@ -501,13 +501,13 @@ "kind": "override" }, { - "rule_id": ".org.matrix.msc3952.is_user_mention", + "rule_id": ".m.rule.is_user_mention", "default": true, "enabled": true, "conditions": [ { "kind": "event_property_contains", - "key": "content.org\\.matrix\\.msc3952\\.mentions.user_ids", + "key": "content.m\\.mentions.user_ids", "value": "@jannemk:element.io" } ], @@ -520,13 +520,13 @@ "kind": "override" }, { - "rule_id": ".org.matrix.msc3952.is_room_mention", + "rule_id": ".m.rule.is_room_mention", "default": true, "enabled": true, "conditions": [ { "kind": "event_property_is", - "key": "content.org\\.matrix\\.msc3952\\.mentions.room", + "key": "content.m\\.mentions.room", "value": true }, { From a010de2508d0168bd7b09f98798b7c74b5b0ff46 Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Wed, 12 Jul 2023 09:43:43 +1200 Subject: [PATCH 6/7] use stable intentional mentions rule sin test models --- .../notificationsettings/pushrules_bug_keyword_only.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/models/notificationsettings/pushrules_bug_keyword_only.json b/test/models/notificationsettings/pushrules_bug_keyword_only.json index 172957e53dd..1526681a634 100644 --- a/test/models/notificationsettings/pushrules_bug_keyword_only.json +++ b/test/models/notificationsettings/pushrules_bug_keyword_only.json @@ -315,13 +315,13 @@ "enabled": true }, { - "rule_id": ".org.matrix.msc3952.is_user_mention", + "rule_id": ".m.rule.is_user_mention", "default": true, "enabled": false, "conditions": [ { "kind": "event_property_contains", - "key": "content.org\\.matrix\\.msc3952\\.mentions.user_ids", + "key": "content.m\\.mentions.user_ids", "value": "@jannemk:element.io" } ], @@ -333,13 +333,13 @@ ] }, { - "rule_id": ".org.matrix.msc3952.is_room_mention", + "rule_id": ".m.rule.is_room_mention", "default": true, "enabled": true, "conditions": [ { "kind": "event_property_is", - "key": "content.org\\.matrix\\.msc3952\\.mentions.room", + "key": "content.m\\.mentions.room", "value": true }, { From e3320e404348c77a2b5f6c8478cc98c13614828a Mon Sep 17 00:00:00 2001 From: Kerry Archibald Date: Wed, 12 Jul 2023 10:03:33 +1200 Subject: [PATCH 7/7] unstable feature in settings controller --- src/settings/Settings.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx index 6e88e6d753e..3f32d27d777 100644 --- a/src/settings/Settings.tsx +++ b/src/settings/Settings.tsx @@ -555,7 +555,7 @@ export const SETTINGS: { [setting: string]: ISetting } = { controller: new ServerSupportUnstableFeatureController( "feature_intentional_mentions", defaultWatchManager, - [], + [["org.matrix.msc3952_intentional_mentions"]], "v1.7", ), },