From 199aa15b4d29c2ffe9d0fc6884645ff0a632ddd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Tue, 12 Sep 2023 15:14:30 +0200 Subject: [PATCH 1/4] Fix schema of user_ids MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- data/api/client-server/definitions/m.mentions.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/api/client-server/definitions/m.mentions.yaml b/data/api/client-server/definitions/m.mentions.yaml index 806897b41..0f79a223e 100644 --- a/data/api/client-server/definitions/m.mentions.yaml +++ b/data/api/client-server/definitions/m.mentions.yaml @@ -28,7 +28,9 @@ example: { } properties: user_ids: - type: string[] + type: array + items: + type: string description: A list of Matrix IDs of mentioned users. room: type: boolean From 5e8e9434e5c2184ae703300f7644176a11d42787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Tue, 12 Sep 2023 15:15:30 +0200 Subject: [PATCH 2/4] Fix example of m.mentions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- data/api/client-server/definitions/m.mentions.yaml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/data/api/client-server/definitions/m.mentions.yaml b/data/api/client-server/definitions/m.mentions.yaml index 0f79a223e..271ee5c55 100644 --- a/data/api/client-server/definitions/m.mentions.yaml +++ b/data/api/client-server/definitions/m.mentions.yaml @@ -18,13 +18,7 @@ description: |- Describes whether the event mentions other users or the room. This is contained within the event's `content` alongside other fields for the relevant event type. example: { - "body": "Hello Alice!", - "msgtype": "m.text", - "format": "org.matrix.custom.html", - "formatted_body": "Hello Alice!", - "m.mentions": { - "user_ids": ["@alice:example.org"] - } + "user_ids": ["@alice:example.org"] } properties: user_ids: From c19cc4a26c2d7b0d1a9e042d0b04611f45618517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Tue, 12 Sep 2023 15:17:59 +0200 Subject: [PATCH 3/4] Add changelog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- changelogs/internal/newsfragments/1635.clarification | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/internal/newsfragments/1635.clarification diff --git a/changelogs/internal/newsfragments/1635.clarification b/changelogs/internal/newsfragments/1635.clarification new file mode 100644 index 000000000..a5bd245c6 --- /dev/null +++ b/changelogs/internal/newsfragments/1635.clarification @@ -0,0 +1 @@ +Fix schema of `m.mentions` object. From 1907de25157cec285ab349dd46333f099fd896d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Tue, 12 Sep 2023 15:50:19 +0200 Subject: [PATCH 4/4] Add back full example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- content/client-server-api/modules/mentions.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/content/client-server-api/modules/mentions.md b/content/client-server-api/modules/mentions.md index 32309740e..0cdbad77c 100644 --- a/content/client-server-api/modules/mentions.md +++ b/content/client-server-api/modules/mentions.md @@ -13,6 +13,20 @@ the event to reference the entity being mentioned. {{% definition path="api/client-server/definitions/m.mentions" %}} +An event's content will then look like this: + +```json +{ + "body": "Hello Alice!", + "msgtype": "m.text", + "format": "org.matrix.custom.html", + "formatted_body": "Hello Alice!", + "m.mentions": { + "user_ids": ["@alice:example.org"] + } +} +``` + Additionally, see the [`.m.rule.is_user_mention`](#_m_rule_is_user_mention) and [`.m.rule.is_room_mention`](#_m_rule_is_room_mention) push rules. Users should not add their own Matrix ID to the `m.mentions` property as outgoing