Skip to content

Commit

Permalink
Fix schema of m.mentions object (#1635)
Browse files Browse the repository at this point in the history
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
  • Loading branch information
zecakeh committed Sep 19, 2023
1 parent 96f88e0 commit df3f0af
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
1 change: 1 addition & 0 deletions changelogs/internal/newsfragments/1635.clarification
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix schema of `m.mentions` object.
14 changes: 14 additions & 0 deletions content/client-server-api/modules/mentions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href='https://matrix.to/#/@alice:example.org'>Alice</a>!",
"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
Expand Down
12 changes: 4 additions & 8 deletions data/api/client-server/definitions/m.mentions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,13 @@ 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 <a href='https://matrix.to/#/@alice:example.org'>Alice</a>!",
"m.mentions": {
"user_ids": ["@alice:example.org"]
}
"user_ids": ["@alice:example.org"]
}
properties:
user_ids:
type: string[]
type: array
items:
type: string
description: A list of Matrix IDs of mentioned users.
room:
type: boolean
Expand Down

0 comments on commit df3f0af

Please sign in to comment.