Compare commits

...

7 commits

Author SHA1 Message Date
Kévin Commaille aa4fe9a537
Merge 7b5935e5cb into fea0b925a0 2025-09-09 18:29:01 +02:00
Patrick Cloke fea0b925a0
Add time zone profile field from MSC4175 (#2206)
Some checks failed
Spec / 🔎 Validate OpenAPI specifications (push) Has been cancelled
Spec / 🔎 Check Event schema examples (push) Has been cancelled
Spec / 🔎 Check OpenAPI definitions examples (push) Has been cancelled
Spec / 🔎 Check JSON Schemas inline examples (push) Has been cancelled
Spec / ⚙️ Calculate baseURL for later jobs (push) Has been cancelled
Spec / 📢 Run towncrier for changelog (push) Has been cancelled
Spell Check / Spell Check with Typos (push) Has been cancelled
Spec / 🐍 Build OpenAPI definitions (push) Has been cancelled
Spec / 📖 Build the spec (push) Has been cancelled
Spec / 🔎 Validate generated HTML (push) Has been cancelled
Spec / 📖 Build the historical backup spec (push) Has been cancelled
2025-09-09 12:02:39 -04:00
Kim Brose bfbeb5e257
clarify world_readable history visibility (#2204)
Signed-off-by: HarHarLinks <2803622+HarHarLinks@users.noreply.github.com>
2025-09-09 16:02:51 +01:00
Kim Brose d1a51f7b8c
fix typo in MSC process (#2205)
Co-authored-by: Andrew Morgan <andrew@amorgan.xyz>
2025-09-09 09:02:32 +00:00
Kévin Commaille 7b5935e5cb
Fix wording
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-08-03 09:04:08 +02:00
Kévin Commaille e3db17eb8e
Add changelog
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-08-02 21:50:19 +02:00
Kévin Commaille 271ae6a0e8
Remove legacy mentions
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-08-02 21:45:27 +02:00
14 changed files with 52 additions and 169 deletions

View file

@ -1 +1 @@
Update user profile endpoints to handle custom fields, and add a new `m.profile_fields` capability,as per [MSC4133](https://github.com/matrix-org/matrix-spec-proposals/pull/4133). Update user profile endpoints to handle custom fields, and add a new `m.profile_fields` capability, as per [MSC4133](https://github.com/matrix-org/matrix-spec-proposals/pull/4133).

View file

@ -0,0 +1 @@
Remove legacy mentions, as per [MSC4210](https://github.com/matrix-org/matrix-spec-proposals/issues/4210).

View file

@ -0,0 +1 @@
Clarify wording around the `world_readable` history visibility setting. Contributed by @HarHarLinks.

View file

@ -0,0 +1 @@
Add a profile field for a user's time zone, per [MSC4175](https://github.com/matrix-org/matrix-spec-proposals/pull/4175).

View file

@ -0,0 +1 @@
Fix a grammatical typo on the Matrix Spec Process documentation page.

View file

@ -16,8 +16,8 @@ The four options for the `m.room.history_visibility` event are:
- `world_readable` - All events while this is the - `world_readable` - All events while this is the
`m.room.history_visibility` value may be shared by any participating `m.room.history_visibility` value may be shared by any participating
homeserver with anyone, regardless of whether they have ever joined homeserver with any authenticated user, regardless of whether they have
the room. ever joined the room. This includes [guest users](#guest-access).
- `shared` - Previous events are always accessible to newly joined - `shared` - Previous events are always accessible to newly joined
members. All events in the room are accessible, even those sent when members. All events in the room are accessible, even those sent when
the member was not a part of the room. the member was not a part of the room.
@ -44,7 +44,7 @@ setting at that time was more restrictive.
#### Client behaviour #### Client behaviour
Clients may want to display a notice that events may be read by Clients may want to display a notice that events may be read by
non-joined people if the history visibility is set to `world_readable`. non-joined users if the history visibility is set to `world_readable`.
#### Server behaviour #### Server behaviour

View file

@ -3,6 +3,9 @@
{{% changed-in v="1.7" %}} {{% changed-in v="1.7" %}}
{{% changed-in v="1.16" %}}: the legacy push rules that looked for mentions in
the `body` of the event were removed.
This module allows users to "mention" other users and rooms within a room event. This module allows users to "mention" other users and rooms within a room event.
This is primarily used as an indicator that the recipient should receive a notification This is primarily used as an indicator that the recipient should receive a notification
about the event. about the event.
@ -38,19 +41,18 @@ encrypted as normal. To properly process mentions in encrypted rooms, events
must be decrypted first. See [receiving notifications](#receiving-notifications). must be decrypted first. See [receiving notifications](#receiving-notifications).
{{% /boxes/warning %}} {{% /boxes/warning %}}
Note that, for backwards compatibility, push rules such as [`.m.rule.contains_display_name`](#_m_rule_contains_display_name), {{% boxes/note %}}
[`.m.rule.contains_user_name`](#_m_rule_contains_user_name), and
[`.m.rule.roomnotif`](#_m_rule_roomnotif) continue to match if the `body` of
the event contains the user's display name or ID. To avoid unintentional notifications,
**it is recommended that clients include a `m.mentions` property on each event**.
(If there are no mentions to include it can be an empty object.)
{{% boxes/rationale %}}
In previous versions of the specification, mentioning users was done by In previous versions of the specification, mentioning users was done by
including the user's display name or the localpart of their Matrix ID and room including the user's display name or the localpart of their Matrix ID and room
mentions were done by including the string "@room" in the plaintext `body` of mentions were done by including the string "@room" in the plaintext `body` of
the event. This was prone to confusing and buggy behaviour. the event. When the `m.mentions` field was introduced, those push rules were
{{% /boxes/rationale %}} disabled if the `m.mentions` field was present.
To avoid unintentional notifications with clients and servers that still use
those push rules, **it is recommended that clients still include a `m.mentions`
property on each event**. (If there are no mentions to include it can be an
empty object.)
{{% /boxes/note %}}
#### Client behaviour #### Client behaviour

View file

@ -382,6 +382,9 @@ The following `alt_aliases` values will NOT match:
**`contains_display_name`** **`contains_display_name`**
{{% changed-in v="1.16" %}}: this condition is deprecated and **should not be
used in new push rules**.
This matches messages where `content.body` contains the owner's display name in This matches messages where `content.body` contains the owner's display name in
that room. This is a separate condition because display names may change and as such that room. This is a separate condition because display names may change and as such
it would be hard to maintain a rule that matched the user's display name. This it would be hard to maintain a rule that matched the user's display name. This
@ -413,6 +416,9 @@ Parameters:
#### Predefined Rules #### Predefined Rules
{{% changed-in v="1.16" %}}: the legacy default push rules that looked for
mentions in the `body` of the event were removed.
Homeservers can specify "server-default rules". They operate at a lower Homeservers can specify "server-default rules". They operate at a lower
priority than "user-defined rules", except for the `.m.rule.master` rule priority than "user-defined rules", except for the `.m.rule.master` rule
which has always a higher priority than any other rule. The `rule_id` which has always a higher priority than any other rule. The `rule_id`
@ -557,41 +563,6 @@ Definition:
} }
``` ```
<a id="_m_rule_contains_display_name"></a> **`.m.rule.contains_display_name`**
{{% changed-in v="1.7" %}}
As of `v1.7`, this rule is deprecated and **should only be enabled if the event
does not have an [`m.mentions` property](#definition-mmentions)**.
Matches any message whose content contains the user's current display name
in the room in which it was sent.
Definition:
```json
{
"rule_id": ".m.rule.contains_display_name",
"default": true,
"enabled": true,
"conditions": [
{
"kind": "contains_display_name"
}
],
"actions": [
"notify",
{
"set_tweak": "sound",
"value": "default"
},
{
"set_tweak": "highlight"
}
]
}
```
<a id="_m_rule_is_room_mention"></a> **`.m.rule.is_room_mention`** <a id="_m_rule_is_room_mention"></a> **`.m.rule.is_room_mention`**
{{% added-in v="1.7" %}} {{% added-in v="1.7" %}}
@ -626,44 +597,6 @@ Definition:
} }
``` ```
<a id="_m_rule_roomnotif"></a> **`.m.rule.roomnotif`**
{{% changed-in v="1.7" %}}
As of `v1.7`, this rule is deprecated and **should only be enabled if the event
does not have an [`m.mentions` property](#definition-mmentions)**.
Matches any message from a sender with the proper power level whose content
contains the text `@room`, signifying the whole room should be notified of
the event.
Definition:
```json
{
"rule_id": ".m.rule.roomnotif",
"default": true,
"enabled": true,
"conditions": [
{
"kind": "event_match",
"key": "content.body",
"pattern": "@room"
},
{
"kind": "sender_notification_permission",
"key": "room"
}
],
"actions": [
"notify",
{
"set_tweak": "highlight"
}
]
}
```
**<a id="mruletombstone"></a>`.m.rule.tombstone`** **<a id="mruletombstone"></a>`.m.rule.tombstone`**
Matches any state event whose type is `m.room.tombstone`. This is Matches any state event whose type is `m.room.tombstone`. This is
@ -776,39 +709,6 @@ Definition:
} }
``` ```
##### Default Content Rules
<a id="_m_rule_contains_user_name"></a> **`.m.rule.contains_user_name`**
{{% changed-in v="1.7" %}}
As of `v1.7`, this rule is deprecated and **should only be enabled if the event
does not have an [`m.mentions` property](#definition-mmentions)**.
Matches any message whose content contains the local part of the user's
Matrix ID, separated by word boundaries.
Definition (as a `content` rule):
```json
{
"rule_id": ".m.rule.contains_user_name",
"default": true,
"enabled": true,
"pattern": "[the local part of the user's Matrix ID]",
"actions": [
"notify",
{
"set_tweak": "sound",
"value": "default"
},
{
"set_tweak": "highlight"
}
]
}
```
##### Default Underride Rules ##### Default Underride Rules
**`.m.rule.call`** **`.m.rule.call`**

View file

@ -6,7 +6,7 @@ It is sometimes desirable to offer a preview of a room, where a user can
This can be particularly effective when combined with [Guest Access](#guest-access). This can be particularly effective when combined with [Guest Access](#guest-access).
Previews are implemented via the `world_readable` [Room History Previews are implemented via the `world_readable` [Room History
Visibility](#room-history-visibility). setting, along with a special version of the [GET Visibility](#room-history-visibility) setting, along with a special version of the [GET
/events](#get_matrixclientv3events) endpoint. /events](#get_matrixclientv3events) endpoint.
#### Client behaviour #### Client behaviour

View file

@ -555,7 +555,7 @@ resolve to the desired MSC, whether it started as an issue or a PR.
Other metadata: Other metadata:
- The MSC number is taken from the GitHub Pull Request ID. This is - The MSC number is taken from the GitHub Pull Request ID. This is
carried for the lifetime of the proposal. These IDs do not necessary carried for the lifetime of the proposal. These IDs do not necessarily
represent a chronological order. represent a chronological order.
- The GitHub PR title will act as the MSC's title. - The GitHub PR title will act as the MSC's title.
- Please link to the spec PR (if any) by adding a "PRs: \#1234" line - Please link to the spec PR (if any) by adding a "PRs: \#1234" line

View file

@ -43,7 +43,7 @@ properties:
example: "All things general" example: "All things general"
world_readable: world_readable:
type: boolean type: boolean
description: Whether the room may be viewed by guest users without joining. description: Whether the room may be viewed by users without joining.
example: false example: false
guest_can_join: guest_can_join:
type: boolean type: boolean

View file

@ -34,24 +34,6 @@ properties:
type: array type: array
type: object type: object
example: { example: {
"content": [
{
"actions": [
"notify",
{
"set_tweak": "sound",
"value": "default"
},
{
"set_tweak": "highlight"
}
],
"default": true,
"enabled": true,
"pattern": "alice",
"rule_id": ".m.rule.contains_user_name"
}
],
"override": [ "override": [
{ {
"actions": [], "actions": [],
@ -113,12 +95,14 @@ example: {
], ],
"conditions": [ "conditions": [
{ {
"kind": "contains_display_name" "kind": "event_property_contains",
"key": "content.m\\.mentions.user_ids",
"value": "@alice:example.com"
} }
], ],
"default": true, "default": true,
"enabled": true, "enabled": true,
"rule_id": ".m.rule.contains_display_name" "rule_id": ".m.rule.is_user_mention"
}, },
{ {
"actions": [ "actions": [

View file

@ -19,7 +19,7 @@ paths:
"/profile/{userId}/{keyName}": "/profile/{userId}/{keyName}":
put: put:
x-changedInMatrixVersion: x-changedInMatrixVersion:
"1.16": This endpoint now accepts a variable `keyName` parameter. Previously only `displayname` and `avatar_url` were accepted. "1.16": This endpoint now accepts a variable `keyName` parameter and `m.tz` was added as a defined key. Previously only `displayname` and `avatar_url` were accepted.
summary: Set a profile field for a user. summary: Set a profile field for a user.
description: |- description: |-
Set or update a profile field for a user. Must be authenticated with an Set or update a profile field for a user. Must be authenticated with an
@ -44,13 +44,13 @@ paths:
- in: path - in: path
name: keyName name: keyName
description: The name of the profile field to set. This MUST be either description: The name of the profile field to set. This MUST be either
`avatar_url`, `displayname`, or a custom field following the `avatar_url`, `displayname`, `m.tz`, or a custom field following the
[Common Namespaced Identifier Grammar](/appendices/#common-namespaced-identifier-grammar). [Common Namespaced Identifier Grammar](/appendices/#common-namespaced-identifier-grammar).
required: true required: true
example: "displayname" example: "displayname"
schema: schema:
type: string type: string
pattern: '^(avatar_url|displayname|[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+)$' pattern: '^(avatar_url|displayname|m\.tz|[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+)$'
requestBody: requestBody:
description: A JSON object containing the property whose name matches description: A JSON object containing the property whose name matches
the `keyName` specified in the URL. See `additionalProperties` for the `keyName` specified in the URL. See `additionalProperties` for
@ -69,6 +69,10 @@ paths:
For `displayname`, the value MUST be a string. For `displayname`, the value MUST be a string.
For `m.tz`, the value MUST be a valid identifier from the [IANA Time Zone Database](https://www.iana.org/time-zones).
Servers MAY choose to validate the value. Clients MUST expect unknown or invalid
values.
For custom keys, any JSON type is allowed. Servers MAY not validate For custom keys, any JSON type is allowed. Servers MAY not validate
these values, but clients SHOULD follow the format defined for that key. these values, but clients SHOULD follow the format defined for that key.
additionalProperties: true additionalProperties: true
@ -137,7 +141,7 @@ paths:
- User data - User data
get: get:
x-changedInMatrixVersion: x-changedInMatrixVersion:
"1.16": This endpoint now accepts a variable `keyName` parameter. Previously only `displayname` and `avatar_url` were accepted. "1.16": This endpoint now accepts a variable `keyName` parameter and `m.tz` was added as a defined key. Previously only `displayname` and `avatar_url` were accepted.
summary: Get a profile field for a user. summary: Get a profile field for a user.
description: Get the value of a profile field for a user. description: Get the value of a profile field for a user.
operationId: getProfileField operationId: getProfileField
@ -156,7 +160,7 @@ paths:
example: "displayname" example: "displayname"
schema: schema:
type: string type: string
pattern: '^(avatar_url|displayname|[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+)$' pattern: '^(avatar_url|displayname|m\.tz|[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+)$'
responses: responses:
"200": "200":
description: The profile field value was retrieved. description: The profile field value was retrieved.
@ -214,7 +218,7 @@ paths:
example: "displayname" example: "displayname"
schema: schema:
type: string type: string
pattern: '^(avatar_url|displayname|[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+)$' pattern: '^(avatar_url|displayname|m\.tz|[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+)$'
responses: responses:
"200": "200":
description: The profile field was deleted or it doesn't exist. description: The profile field was deleted or it doesn't exist.
@ -293,6 +297,10 @@ paths:
type: string type: string
description: The user's display name if they have set one, otherwise not description: The user's display name if they have set one, otherwise not
present. present.
m.tz:
x-addedInMatrixVersion: "1.16"
type: string
description: The user's time zone.
additionalProperties: additionalProperties:
x-addedInMatrixVersion: "1.16" x-addedInMatrixVersion: "1.16"
description: Additional profile fields. description: Additional profile fields.
@ -302,6 +310,7 @@ paths:
{ {
"avatar_url": "mxc://matrix.org/SDGdghriugerRg", "avatar_url": "mxc://matrix.org/SDGdghriugerRg",
"displayname": "Alice Margatroid", "displayname": "Alice Margatroid",
"m.tz": "Europe/London",
"m.example_field": "custom_value", "m.example_field": "custom_value",
} }
"403": "403":

View file

@ -3,24 +3,6 @@
"type": "m.push_rules", "type": "m.push_rules",
"content": { "content": {
"global": { "global": {
"content": [
{
"actions": [
"notify",
{
"set_tweak": "sound",
"value": "default"
},
{
"set_tweak": "highlight"
}
],
"default": true,
"enabled": true,
"pattern": "alice",
"rule_id": ".m.rule.contains_user_name"
}
],
"override": [ "override": [
{ {
"actions": [], "actions": [],
@ -82,12 +64,14 @@
], ],
"conditions": [ "conditions": [
{ {
"kind": "contains_display_name" "kind": "event_property_contains",
"key": "content.m\\.mentions.user_ids",
"value": "@alice:example.com"
} }
], ],
"default": true, "default": true,
"enabled": true, "enabled": true,
"rule_id": ".m.rule.contains_display_name" "rule_id": ".m.rule.is_user_mention"
}, },
{ {
"actions": [ "actions": [