mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-04-29 05:44:10 +02:00
Compare commits
43 commits
63e2928dbf
...
361748c33e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
361748c33e | ||
|
|
67743d5715 | ||
|
|
338047ec7b | ||
|
|
0439707624 | ||
|
|
f4e6e6dea9 | ||
|
|
73fcf366a0 | ||
|
|
0a1efd8c9c | ||
|
|
2c6ddafb43 | ||
|
|
fc81171081 | ||
|
|
c74befd111 | ||
|
|
6183f2410f | ||
|
|
dd4ea948b6 | ||
|
|
50eab3501e | ||
|
|
37b1362bc1 | ||
|
|
d8cc250d20 | ||
|
|
b5e2edf2e5 | ||
|
|
7ef1d9d0ec | ||
|
|
3a5e5555fa | ||
|
|
9889fe3584 | ||
|
|
013502b0c0 | ||
|
|
9859e20927 | ||
|
|
7a3b0c0804 | ||
|
|
0b0942d192 | ||
|
|
1cc93ec951 | ||
|
|
79af78022e | ||
|
|
17af55ddce | ||
|
|
79a1cded02 | ||
|
|
76b48e25d0 | ||
|
|
5d5b561140 | ||
|
|
9327793007 | ||
|
|
f3c269d951 | ||
|
|
3311b084bf | ||
|
|
992cf9dc35 | ||
|
|
4f8999be0a | ||
|
|
82adcec491 | ||
|
|
41c64c877b | ||
|
|
8e9874ad22 | ||
|
|
ee9b5ddcca | ||
|
|
59d2c62d2d | ||
|
|
b2e122f308 | ||
|
|
1fc01189f3 | ||
|
|
212377e393 | ||
|
|
fdc012ac01 |
5
.github/workflows/main.yml
vendored
5
.github/workflows/main.yml
vendored
|
|
@ -284,10 +284,11 @@ jobs:
|
||||||
npm i
|
npm i
|
||||||
npm run get-proposals
|
npm run get-proposals
|
||||||
- name: "⚙️ hugo"
|
- name: "⚙️ hugo"
|
||||||
|
env:
|
||||||
|
HUGO_PARAMS_VERSION_STATUS: "historical"
|
||||||
# Create a baseURL like `/v1.2` out of the `v1.2` tag
|
# Create a baseURL like `/v1.2` out of the `v1.2` tag
|
||||||
run: |
|
run: |
|
||||||
echo -e '[params.version]\nstatus="historical"' > historical.toml
|
hugo --baseURL "/${GITHUB_REF/refs\/tags\//}" -d "spec"
|
||||||
hugo --config config.toml,historical.toml --baseURL "/${GITHUB_REF/refs\/tags\//}" -d "spec"
|
|
||||||
|
|
||||||
- name: "📥 Spec definition download"
|
- name: "📥 Spec definition download"
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
|
|
|
||||||
1
changelogs/client_server/newsfragments/2071.feature
Normal file
1
changelogs/client_server/newsfragments/2071.feature
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Feature: Update profile endpoints to become generic to support [MSC4133](https://github.com/matrix-org/matrix-spec-proposals/pull/4133) extended fields. Extended profile fields are now supported via the new `m.profile_fields` capability, which deprecates the previous `m.set_avatar_url` and `m.set_displayname` capabilities. Stabilised keys are explicitly enumerated, and custom keys must conform to the Common Namespaced Identifier Grammar.
|
||||||
1
changelogs/client_server/newsfragments/2095.feature
Normal file
1
changelogs/client_server/newsfragments/2095.feature
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Add `m.topic` content block to enable rich text in `m.room.topic` events as per [MSC3765](https://github.com/matrix-org/matrix-spec-proposals/pull/3765).
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
"Public" rooms in profile look-ups are defined through their join rule and history visibility.
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
"Public" rooms in user directory queries are defined through their join rule and history visibility.
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
"Public" rooms with respect to call invites are defined through their join rule.
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
"Public" rooms have no specific meaning with respect to moderation policy lists.
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
"Public" rooms with respect to presence are defined through their join rule.
|
||||||
1
changelogs/internal/newsfragments/2123.clarification
Normal file
1
changelogs/internal/newsfragments/2123.clarification
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Fix the historical info box when generating the historical spec in CI.
|
||||||
1
changelogs/server_server/newsfragments/2095.feature
Normal file
1
changelogs/server_server/newsfragments/2095.feature
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Add `m.topic` content block to enable rich text in `m.room.topic` events as per [MSC3765](https://github.com/matrix-org/matrix-spec-proposals/pull/3765).
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
Clarify that auth event of `content.join_authorised_via_users_server` is only necessary for `m.room.member` with a `membership` of `join`.
|
||||||
|
|
@ -2862,10 +2862,15 @@ re-invited.
|
||||||
|
|
||||||
#### Server behaviour
|
#### Server behaviour
|
||||||
|
|
||||||
Homeservers MUST at a minimum allow profile look-up for:
|
Homeservers MUST at a minimum allow profile look-up for users who are
|
||||||
|
visible to the requester based on their membership in rooms known to the
|
||||||
|
homeserver. This means:
|
||||||
|
|
||||||
- users that share a room with the requesting user
|
- users that share a room with the requesting user
|
||||||
- users that reside in public rooms known to the homeserver
|
- users who are joined to rooms known to the homeserver that have a
|
||||||
|
`public` [join rule](#mroomjoin_rules)
|
||||||
|
- users who are joined to rooms known to the homeserver that have a
|
||||||
|
`world_readable` [history visibility](#room-history-visibility)
|
||||||
|
|
||||||
In all other cases, homeservers MAY deny profile look-up by responding with
|
In all other cases, homeservers MAY deny profile look-up by responding with
|
||||||
403 and an error code of `M_FORBIDDEN`.
|
403 and an error code of `M_FORBIDDEN`.
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ for sending events:
|
||||||
The following API endpoints are allowed to be accessed by guest accounts
|
The following API endpoints are allowed to be accessed by guest accounts
|
||||||
for their own account maintenance:
|
for their own account maintenance:
|
||||||
|
|
||||||
* [PUT /profile/{userId}/displayname](#put_matrixclientv3profileuseriddisplayname)
|
* [PUT /profile/{userId}/{key_name}](#put_matrixclientv3profileuseridkeyname)
|
||||||
* [GET /devices](#get_matrixclientv3devices)
|
* [GET /devices](#get_matrixclientv3devices)
|
||||||
* [GET /devices/{deviceId}](#get_matrixclientv3devicesdeviceid)
|
* [GET /devices/{deviceId}](#get_matrixclientv3devicesdeviceid)
|
||||||
* [PUT /devices/{deviceId}](#put_matrixclientv3devicesdeviceid)
|
* [PUT /devices/{deviceId}](#put_matrixclientv3devicesdeviceid)
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,9 @@ the entity making the decisions on filtering is best positioned to
|
||||||
interpret the rules how it sees fit.
|
interpret the rules how it sees fit.
|
||||||
|
|
||||||
Moderation policy lists are stored as room state events. There are no
|
Moderation policy lists are stored as room state events. There are no
|
||||||
restrictions on how the rooms can be configured (they could be public,
|
restrictions on how the rooms can be configured in terms of
|
||||||
private, encrypted, etc).
|
[join rules](#mroomjoin_rules), [history visibility](#room-history-visibility),
|
||||||
|
encryption, etc.
|
||||||
|
|
||||||
There are currently 3 kinds of entities which can be affected by rules:
|
There are currently 3 kinds of entities which can be affected by rules:
|
||||||
`user`, `server`, and `room`. All 3 are described with
|
`user`, `server`, and `room`. All 3 are described with
|
||||||
|
|
|
||||||
|
|
@ -68,5 +68,7 @@ will cause the server to automatically set their presence to `online`.
|
||||||
|
|
||||||
#### Security considerations
|
#### Security considerations
|
||||||
|
|
||||||
Presence information is shared with all users who share a room with the
|
Presence information is published to all users who share a room with the
|
||||||
target user. In large public rooms this could be undesirable.
|
target user. If the target user is a member of a room with a `public`
|
||||||
|
[join rule](#mroomjoin_rules), any other user in the federation is
|
||||||
|
able to gain access to the target user's presence. This could be undesirable.
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,10 @@ on certain keys of certain event types.
|
||||||
|
|
||||||
The supported keys to search over are:
|
The supported keys to search over are:
|
||||||
|
|
||||||
- `content.body` in `m.room.message`
|
- `content.body` in [`m.room.message`](/client-server-api/#mroommessage)
|
||||||
- `content.name` in `m.room.name`
|
- `content.name` in [`m.room.name`](/client-server-api/#mroomname)
|
||||||
- `content.topic` in `m.room.topic`
|
- In [`m.room.topic`](/client-server-api/#mroomtopic), `content.topic`
|
||||||
|
as well as the `body` of the `text/plain` representation in `content['m.topic']`.
|
||||||
|
|
||||||
The search will *not* include rooms that are end to end encrypted.
|
The search will *not* include rooms that are end to end encrypted.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -202,11 +202,13 @@ specific user, and should be set to the Matrix user ID of that user. Invites
|
||||||
without an `invitee` field are defined to be intended for any member of the
|
without an `invitee` field are defined to be intended for any member of the
|
||||||
room other than the sender of the event.
|
room other than the sender of the event.
|
||||||
|
|
||||||
Clients should consider an incoming call if they see a non-expired invite event where the `invitee` field is either
|
Clients should consider an incoming call if they see a non-expired invite event
|
||||||
absent or equal to their user's Matrix ID, however they should evaluate whether or not to ring based on their
|
where the `invitee` field is either absent or equal to their user's Matrix ID.
|
||||||
user's trust relationship with the callers and/or where the call was placed. As a starting point, it is
|
They should, however, evaluate whether or not to ring based on their user's trust
|
||||||
suggested that clients ignore call invites from users in public rooms. It is strongly recommended that
|
relationship with the callers and/or where the call was placed. As a starting
|
||||||
when clients do not ring for an incoming call invite, they still display the call invite in the room and
|
point, it is RECOMMENDED that clients ignore call invites in rooms with a
|
||||||
|
[join rule](#mroomjoin_rules) of `public`. When clients suppress ringing for an
|
||||||
|
incoming call invite, they SHOULD still display the call invite in the room and
|
||||||
annotate that it was ignored.
|
annotate that it was ignored.
|
||||||
|
|
||||||
##### Glare
|
##### Glare
|
||||||
|
|
|
||||||
|
|
@ -544,8 +544,8 @@ the following subset of the room state:
|
||||||
`third_party_invite` property, the current
|
`third_party_invite` property, the current
|
||||||
`m.room.third_party_invite` event with `state_key` matching
|
`m.room.third_party_invite` event with `state_key` matching
|
||||||
`content.third_party_invite.signed.token`, if any.
|
`content.third_party_invite.signed.token`, if any.
|
||||||
- If `content.join_authorised_via_users_server` is present,
|
- If `membership` is `join`, `content.join_authorised_via_users_server`
|
||||||
and the [room version supports restricted rooms](/rooms/#feature-matrix),
|
is present, and the [room version supports restricted rooms](/rooms/#feature-matrix),
|
||||||
then the `m.room.member` event with `state_key` matching
|
then the `m.room.member` event with `state_key` matching
|
||||||
`content.join_authorised_via_users_server`.
|
`content.join_authorised_via_users_server`.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,11 +73,17 @@ paths:
|
||||||
- default
|
- default
|
||||||
- available
|
- available
|
||||||
m.set_displayname:
|
m.set_displayname:
|
||||||
|
deprecated: true
|
||||||
$ref: '#/components/schemas/booleanCapability'
|
$ref: '#/components/schemas/booleanCapability'
|
||||||
description: Capability to indicate if the user can change their display name.
|
description: |
|
||||||
|
**Deprecated:** Capability to indicate if the user can change their display name.
|
||||||
|
Please refer to `m.profile_fields` for extended profile management.
|
||||||
m.set_avatar_url:
|
m.set_avatar_url:
|
||||||
|
deprecated: true
|
||||||
$ref: '#/components/schemas/booleanCapability'
|
$ref: '#/components/schemas/booleanCapability'
|
||||||
description: Capability to indicate if the user can change their avatar.
|
description: |
|
||||||
|
**Deprecated:** Capability to indicate if the user can change their avatar.
|
||||||
|
Please refer to `m.profile_fields` for extended profile management.
|
||||||
m.3pid_changes:
|
m.3pid_changes:
|
||||||
$ref: '#/components/schemas/booleanCapability'
|
$ref: '#/components/schemas/booleanCapability'
|
||||||
description: Capability to indicate if the user can change 3PID associations
|
description: Capability to indicate if the user can change 3PID associations
|
||||||
|
|
@ -86,6 +92,37 @@ paths:
|
||||||
$ref: '#/components/schemas/booleanCapability'
|
$ref: '#/components/schemas/booleanCapability'
|
||||||
description: Capability to indicate if the user can generate tokens to log further
|
description: Capability to indicate if the user can generate tokens to log further
|
||||||
clients into their account.
|
clients into their account.
|
||||||
|
m.profile_fields:
|
||||||
|
x-addedInMatrixVersion: "1.14"
|
||||||
|
type: object
|
||||||
|
title: ProfileFieldsCapability
|
||||||
|
description: Capability to indicate if the user can set or modify extended profile fields.
|
||||||
|
If absent, clients should assume custom profile fields are supported.
|
||||||
|
properties:
|
||||||
|
allowed:
|
||||||
|
type: array
|
||||||
|
description: List of allowed additional custom profile field keys. A `*` can be used as a
|
||||||
|
wildcard to match any sequence of characters. This list takes precedence over the
|
||||||
|
disallowed list if both are provided.
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
example:
|
||||||
|
- "m.example_field"
|
||||||
|
- "org.example/job_title"
|
||||||
|
disallowed:
|
||||||
|
type: array
|
||||||
|
description: List of disallowed additional custom profile field keys. A `*` can be used as
|
||||||
|
a wildcard to match any sequence of characters. Ignored if an allowed list is provided.
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
example:
|
||||||
|
- "org.example.secret_field"
|
||||||
|
enabled:
|
||||||
|
type: boolean
|
||||||
|
description: True if the user can set or modify any extended profile fields, false otherwise.
|
||||||
|
example: true
|
||||||
|
required:
|
||||||
|
- enabled
|
||||||
examples:
|
examples:
|
||||||
response:
|
response:
|
||||||
value: {
|
value: {
|
||||||
|
|
|
||||||
|
|
@ -109,15 +109,17 @@ paths:
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
description: |-
|
description: |-
|
||||||
If this is included, an `m.room.name` event will be sent
|
If this is included, an [`m.room.name`](/client-server-api/#mroomname) event
|
||||||
into the room to indicate the name of the room. See Room
|
will be sent into the room to indicate the name for the room.
|
||||||
Events for more information on `m.room.name`.
|
This overwrites any [`m.room.name`](/client-server-api/#mroomname)
|
||||||
|
event in `initial_state`.
|
||||||
topic:
|
topic:
|
||||||
type: string
|
type: string
|
||||||
description: |-
|
description: |-
|
||||||
If this is included, an `m.room.topic` event will be sent
|
If this is included, an [`m.room.topic`](/client-server-api/#mroomtopic)
|
||||||
into the room to indicate the topic for the room. See Room
|
event with a `text/plain` mimetype will be sent into the room
|
||||||
Events for more information on `m.room.topic`.
|
to indicate the topic for the room. This overwrites any
|
||||||
|
[`m.room.topic`](/client-server-api/#mroomtopic) event in `initial_state`.
|
||||||
invite:
|
invite:
|
||||||
type: array
|
type: array
|
||||||
description: |-
|
description: |-
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,9 @@ properties:
|
||||||
example: "!abcdefg:example.org"
|
example: "!abcdefg:example.org"
|
||||||
topic:
|
topic:
|
||||||
type: string
|
type: string
|
||||||
description: The topic of the room, if any.
|
description: |-
|
||||||
|
The plain text topic of the room. Omitted if no `text/plain` mimetype
|
||||||
|
exists in [`m.room.topic`](/client-server-api/#mroomtopic).
|
||||||
example: "All things general"
|
example: "All things general"
|
||||||
world_readable:
|
world_readable:
|
||||||
type: boolean
|
type: boolean
|
||||||
|
|
|
||||||
|
|
@ -16,48 +16,105 @@ info:
|
||||||
title: Matrix Client-Server Profile API
|
title: Matrix Client-Server Profile API
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
paths:
|
paths:
|
||||||
"/profile/{userId}/displayname":
|
"/profile/{userId}/{keyName}":
|
||||||
put:
|
put:
|
||||||
summary: Set the user's display name.
|
x-changedInMatrixVersion:
|
||||||
|
"1.14": Endpoint now accepts variable `keyName` parameter.
|
||||||
|
summary: Set a profile field for a user.
|
||||||
description: |-
|
description: |-
|
||||||
This API sets the given user's display name. You must have permission to
|
Set or update a profile field for a user. Must be authenticated with an
|
||||||
set this user's display name, e.g. you need to have their `access_token`.
|
access token authorised to make changes. Servers may impose size limits
|
||||||
operationId: setDisplayName
|
on individual fields, and the total profile must be under 64 KiB.
|
||||||
|
|
||||||
|
**Note**: Setting a field to `null` keeps the key but with a `null` value,
|
||||||
|
which some servers may reject. To remove a field completely, use the
|
||||||
|
`DELETE` endpoint instead.
|
||||||
|
operationId: setProfileField
|
||||||
security:
|
security:
|
||||||
- accessTokenQuery: []
|
- accessTokenQuery: []
|
||||||
- accessTokenBearer: []
|
- accessTokenBearer: []
|
||||||
parameters:
|
parameters:
|
||||||
- in: path
|
- in: path
|
||||||
name: userId
|
name: userId
|
||||||
description: The user whose display name to set.
|
description: The user whose profile field to set.
|
||||||
required: true
|
required: true
|
||||||
example: "@alice:example.com"
|
example: "@alice:example.com"
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
- in: path
|
||||||
|
name: keyName
|
||||||
|
description: The profile field key name to set. It must be either
|
||||||
|
`avatar_url`, `displayname`, or a custom field following the
|
||||||
|
[Common Namespaced Identifier Grammar](/appendices/#common-namespaced-identifier-grammar).
|
||||||
|
required: true
|
||||||
|
example: "displayname"
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
pattern: '^(avatar_url|displayname|[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+)$'
|
||||||
requestBody:
|
requestBody:
|
||||||
|
description: A JSON object containing the property whose name matches
|
||||||
|
the `keyName` specified in the URL. See `additionalProperties` for
|
||||||
|
further details.
|
||||||
|
required: true
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
type: object
|
||||||
example: {
|
minProperties: 1
|
||||||
"displayname": "Alice Margatroid"
|
additionalProperties:
|
||||||
}
|
description: The JSON object must include a property whose key
|
||||||
properties:
|
matches the `keyName` specified in the URL. For `avatar_url`,
|
||||||
displayname:
|
the value must be an MXC URI string. For `displayname`, the value
|
||||||
type: string
|
must be a string. For custom keys, any JSON type is allowed -
|
||||||
description: The new display name for this user.
|
servers may not validate these values, but clients should follow
|
||||||
description: The new display name information.
|
the format defined for that key.
|
||||||
required: true
|
example: { "displayname": "Alice Wonderland" }
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: The display name was set.
|
description: The profile field was set.
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object # empty json object
|
type: object # empty JSON object
|
||||||
examples:
|
examples:
|
||||||
response:
|
response:
|
||||||
value: {}
|
value: {}
|
||||||
|
"400":
|
||||||
|
description: The request is malformed, contains invalid JSON, missing
|
||||||
|
a required parameter, specifies an invalid key, or exceeds allowed
|
||||||
|
size limits.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: definitions/errors/error.yaml
|
||||||
|
examples:
|
||||||
|
bad_json:
|
||||||
|
value:
|
||||||
|
{
|
||||||
|
"errcode": "M_BAD_JSON",
|
||||||
|
"error": "Malformed JSON payload.",
|
||||||
|
}
|
||||||
|
invalid_key:
|
||||||
|
value:
|
||||||
|
{
|
||||||
|
"errcode": "M_INVALID_PARAM",
|
||||||
|
"error": "Invalid profile key.",
|
||||||
|
}
|
||||||
|
"403":
|
||||||
|
description: The server is unwilling to perform the operation, either
|
||||||
|
due to insufficient permissions or because profile modifications
|
||||||
|
are disabled.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: definitions/errors/error.yaml
|
||||||
|
examples:
|
||||||
|
forbidden:
|
||||||
|
value:
|
||||||
|
{
|
||||||
|
"errcode": "M_FORBIDDEN",
|
||||||
|
"error": "Profile modification is not permitted.",
|
||||||
|
}
|
||||||
"429":
|
"429":
|
||||||
description: This request was rate-limited.
|
description: This request was rate-limited.
|
||||||
content:
|
content:
|
||||||
|
|
@ -67,98 +124,133 @@ paths:
|
||||||
tags:
|
tags:
|
||||||
- User data
|
- User data
|
||||||
get:
|
get:
|
||||||
summary: Get the user's display name.
|
x-changedInMatrixVersion:
|
||||||
description: |-
|
"1.14": Endpoint now accepts variable `keyName` parameter.
|
||||||
Get the user's display name. This API may be used to fetch the user's
|
summary: Get a profile field for a user.
|
||||||
own displayname or to query the name of other users; either locally or
|
description: Get the value of a profile field for a user. Any individual
|
||||||
on remote homeservers.
|
field must be within the total profile limit of 64 KiB.
|
||||||
operationId: getDisplayName
|
operationId: getProfileField
|
||||||
parameters:
|
parameters:
|
||||||
- in: path
|
- in: path
|
||||||
name: userId
|
name: userId
|
||||||
description: The user whose display name to get.
|
description: The user whose profile field to get.
|
||||||
required: true
|
required: true
|
||||||
example: "@alice:example.com"
|
example: "@alice:example.com"
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
- in: path
|
||||||
|
name: keyName
|
||||||
|
description: The profile field key name to retrieve. It must be either
|
||||||
|
`avatar_url`, `displayname`, or a custom field following the
|
||||||
|
[Common Namespaced Identifier Grammar](/appendices/#common-namespaced-identifier-grammar).
|
||||||
|
required: true
|
||||||
|
example: "displayname"
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
pattern: '^(avatar_url|displayname|[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+)$'
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: The display name for this user.
|
description: The profile field value was retrieved.
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
minProperties: 1
|
||||||
displayname:
|
additionalProperties:
|
||||||
type: string
|
description: The JSON response includes a property whose key
|
||||||
description: The user's display name if they have set one, otherwise not
|
matches the `keyName` specified in the URL. For `avatar_url`,
|
||||||
present.
|
the value will be an MXC URI string. For `displayname`, the
|
||||||
|
value will be a string. For custom keys, any JSON type is
|
||||||
|
possible - clients should expect the format defined for that key.
|
||||||
examples:
|
examples:
|
||||||
response:
|
response:
|
||||||
value: {
|
value: { "displayname": "Alice" }
|
||||||
"displayname": "Alice Margatroid"
|
|
||||||
}
|
|
||||||
"403":
|
"403":
|
||||||
x-addedInMatrixVersion: "1.12"
|
x-addedInMatrixVersion: "1.12"
|
||||||
description: The server is unwilling to disclose whether the user exists and/or
|
description: The server is unwilling to disclose whether the user
|
||||||
has a display name.
|
exists and/or has the specified profile field.
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: definitions/errors/error.yaml
|
$ref: definitions/errors/error.yaml
|
||||||
examples:
|
examples:
|
||||||
response:
|
response:
|
||||||
value: {
|
value:
|
||||||
"errcode": "M_FORBIDDEN",
|
{
|
||||||
"error": "Profile lookup is disabled on this homeserver"
|
"errcode": "M_FORBIDDEN",
|
||||||
}
|
"error": "Profile lookup is disabled on this homeserver",
|
||||||
|
}
|
||||||
"404":
|
"404":
|
||||||
description: There is no display name for this user or this user does not exist.
|
description: There is no profile field with this key for this user, or
|
||||||
|
the user does not exist.
|
||||||
tags:
|
tags:
|
||||||
- User data
|
- User data
|
||||||
"/profile/{userId}/avatar_url":
|
delete:
|
||||||
put:
|
x-addedInMatrixVersion: "1.14"
|
||||||
summary: Set the user's avatar URL.
|
summary: Remove a profile field from a user.
|
||||||
description: |-
|
description: Remove a specific field from a user's profile.
|
||||||
This API sets the given user's avatar URL. You must have permission to
|
operationId: deleteProfileField
|
||||||
set this user's avatar URL, e.g. you need to have their `access_token`.
|
|
||||||
operationId: setAvatarUrl
|
|
||||||
security:
|
security:
|
||||||
- accessTokenQuery: []
|
- accessTokenQuery: []
|
||||||
- accessTokenBearer: []
|
- accessTokenBearer: []
|
||||||
parameters:
|
parameters:
|
||||||
- in: path
|
- in: path
|
||||||
name: userId
|
name: userId
|
||||||
description: The user whose avatar URL to set.
|
description: The user whose profile field to delete.
|
||||||
required: true
|
required: true
|
||||||
example: "@alice:example.com"
|
example: "@alice:example.com"
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
requestBody:
|
- in: path
|
||||||
content:
|
name: keyName
|
||||||
application/json:
|
description: The profile field key name to delete. It must be either
|
||||||
schema:
|
`avatar_url`, `displayname`, or a custom field following the
|
||||||
type: object
|
[Common Namespaced Identifier Grammar](/appendices/#common-namespaced-identifier-grammar).
|
||||||
example: {
|
required: true
|
||||||
"avatar_url": "mxc://matrix.org/wefh34uihSDRGhw34"
|
example: "displayname"
|
||||||
}
|
schema:
|
||||||
properties:
|
type: string
|
||||||
avatar_url:
|
pattern: '^(avatar_url|displayname|[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+)$'
|
||||||
type: string
|
|
||||||
format: uri
|
|
||||||
description: The new avatar URL for this user.
|
|
||||||
description: The new avatar information.
|
|
||||||
required: true
|
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: The avatar URL was set.
|
description: The profile field was deleted.
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object # empty json object
|
type: object
|
||||||
examples:
|
examples:
|
||||||
response:
|
response:
|
||||||
value: {}
|
value: {}
|
||||||
|
"400":
|
||||||
|
description: The request is malformed, contains invalid JSON, or
|
||||||
|
specifies an invalid key.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: definitions/errors/error.yaml
|
||||||
|
examples:
|
||||||
|
bad_json:
|
||||||
|
value:
|
||||||
|
{ "errcode": "M_BAD_JSON", "error": "Malformed request." }
|
||||||
|
invalid_key:
|
||||||
|
value:
|
||||||
|
{
|
||||||
|
"errcode": "M_INVALID_PARAM",
|
||||||
|
"error": "Invalid profile key.",
|
||||||
|
}
|
||||||
|
"403":
|
||||||
|
description: The user is not authorised to delete this profile field.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: definitions/errors/error.yaml
|
||||||
|
examples:
|
||||||
|
forbidden:
|
||||||
|
value:
|
||||||
|
{
|
||||||
|
"errcode": "M_FORBIDDEN",
|
||||||
|
"error": "Profile deletion is not permitted.",
|
||||||
|
}
|
||||||
"429":
|
"429":
|
||||||
description: This request was rate-limited.
|
description: This request was rate-limited.
|
||||||
content:
|
content:
|
||||||
|
|
@ -167,63 +259,15 @@ paths:
|
||||||
$ref: definitions/errors/rate_limited.yaml
|
$ref: definitions/errors/rate_limited.yaml
|
||||||
tags:
|
tags:
|
||||||
- User data
|
- User data
|
||||||
get:
|
|
||||||
summary: Get the user's avatar URL.
|
|
||||||
description: |-
|
|
||||||
Get the user's avatar URL. This API may be used to fetch the user's
|
|
||||||
own avatar URL or to query the URL of other users; either locally or
|
|
||||||
on remote homeservers.
|
|
||||||
operationId: getAvatarUrl
|
|
||||||
parameters:
|
|
||||||
- in: path
|
|
||||||
name: userId
|
|
||||||
description: The user whose avatar URL to get.
|
|
||||||
required: true
|
|
||||||
example: "@alice:example.com"
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
description: The avatar URL for this user.
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
avatar_url:
|
|
||||||
type: string
|
|
||||||
format: uri
|
|
||||||
description: The user's avatar URL if they have set one, otherwise not present.
|
|
||||||
examples:
|
|
||||||
response:
|
|
||||||
value: {
|
|
||||||
"avatar_url": "mxc://matrix.org/SDGdghriugerRg"
|
|
||||||
}
|
|
||||||
"403":
|
|
||||||
x-addedInMatrixVersion: "1.12"
|
|
||||||
description: The server is unwilling to disclose whether the user exists and/or
|
|
||||||
has an avatar URL.
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: definitions/errors/error.yaml
|
|
||||||
examples:
|
|
||||||
response:
|
|
||||||
value: {
|
|
||||||
"errcode": "M_FORBIDDEN",
|
|
||||||
"error": "Profile lookup is disabled on this homeserver"
|
|
||||||
}
|
|
||||||
"404":
|
|
||||||
description: There is no avatar URL for this user or this user does not exist.
|
|
||||||
tags:
|
|
||||||
- User data
|
|
||||||
"/profile/{userId}":
|
"/profile/{userId}":
|
||||||
get:
|
get:
|
||||||
summary: Get this user's profile information.
|
summary: Get all profile information for a user.
|
||||||
description: |-
|
description: |-
|
||||||
Get the combined profile information for this user. This API may be used
|
Get the complete profile for a user. The response includes `avatar_url`
|
||||||
to fetch the user's own profile information or other users; either
|
and `displayname` (unless set to `null`, as they can only be strings)
|
||||||
locally or on remote homeservers.
|
plus any custom profile fields.
|
||||||
|
|
||||||
|
**Note**: The complete profile must be under 64 KiB.
|
||||||
operationId: getUserProfile
|
operationId: getUserProfile
|
||||||
parameters:
|
parameters:
|
||||||
- in: path
|
- in: path
|
||||||
|
|
@ -243,45 +287,49 @@ paths:
|
||||||
properties:
|
properties:
|
||||||
avatar_url:
|
avatar_url:
|
||||||
type: string
|
type: string
|
||||||
format: uri
|
format: mx-mxc-uri
|
||||||
description: The user's avatar URL if they have set one, otherwise not present.
|
description: "Avatar URL value (MXC URI format)."
|
||||||
displayname:
|
displayname:
|
||||||
type: string
|
type: string
|
||||||
description: The user's display name if they have set one, otherwise not
|
additionalProperties:
|
||||||
present.
|
x-addedInMatrixVersion: "1.14"
|
||||||
|
description: Any additional profile field value; may be any
|
||||||
|
valid JSON type, with keys following the
|
||||||
|
[Common Namespaced Identifier Grammar](/appendices/#common-namespaced-identifier-grammar).
|
||||||
examples:
|
examples:
|
||||||
response:
|
response:
|
||||||
value: {
|
value:
|
||||||
"avatar_url": "mxc://matrix.org/SDGdghriugerRg",
|
{
|
||||||
"displayname": "Alice Margatroid"
|
"avatar_url": "mxc://matrix.org/SDGdghriugerRg",
|
||||||
}
|
"displayname": "Alice Margatroid",
|
||||||
|
"m.example_field": "custom_value",
|
||||||
|
}
|
||||||
"403":
|
"403":
|
||||||
x-addedInMatrixVersion: "1.2"
|
x-addedInMatrixVersion: "1.2"
|
||||||
description: The server is unwilling to disclose whether the user exists and/or
|
description: The server is unwilling to disclose whether the user
|
||||||
has profile information.
|
exists and/or has profile information.
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: definitions/errors/error.yaml
|
$ref: definitions/errors/error.yaml
|
||||||
examples:
|
examples:
|
||||||
response:
|
response:
|
||||||
value: {
|
value:
|
||||||
"errcode": "M_FORBIDDEN",
|
{
|
||||||
"error": "Profile lookup is disabled on this homeserver"
|
"errcode": "M_FORBIDDEN",
|
||||||
}
|
"error": "Profile lookup is disabled on this homeserver",
|
||||||
|
}
|
||||||
"404":
|
"404":
|
||||||
description: There is no profile information for this user or this user does not
|
description: There is no profile information for this user or this
|
||||||
exist.
|
user does not exist.
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: definitions/errors/error.yaml
|
$ref: definitions/errors/error.yaml
|
||||||
examples:
|
examples:
|
||||||
response:
|
response:
|
||||||
value: {
|
value:
|
||||||
"errcode": "M_NOT_FOUND",
|
{ "errcode": "M_NOT_FOUND", "error": "Profile not found" }
|
||||||
"error": "Profile not found"
|
|
||||||
}
|
|
||||||
tags:
|
tags:
|
||||||
- User data
|
- User data
|
||||||
servers:
|
servers:
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,17 @@ paths:
|
||||||
post:
|
post:
|
||||||
summary: Searches the user directory.
|
summary: Searches the user directory.
|
||||||
description: |-
|
description: |-
|
||||||
Performs a search for users. The homeserver may
|
Performs a search for users. The homeserver may determine which
|
||||||
determine which subset of users are searched, however the homeserver
|
subset of users are searched. However, the homeserver MUST at a
|
||||||
MUST at a minimum consider the users the requesting user shares a
|
minimum consider users who are visible to the requester based
|
||||||
room with and those who reside in public rooms (known to the homeserver).
|
on their membership in rooms known to the homeserver. This means:
|
||||||
|
|
||||||
|
- users that share a room with the requesting user
|
||||||
|
- users who are joined to rooms known to the homeserver that have a
|
||||||
|
`public` [join rule](#mroomjoin_rules)
|
||||||
|
- users who are joined to rooms known to the homeserver that have a
|
||||||
|
`world_readable` [history visibility](#room-history-visibility)
|
||||||
|
|
||||||
The search MUST consider local users to the homeserver, and SHOULD
|
The search MUST consider local users to the homeserver, and SHOULD
|
||||||
query remote users as part of the search.
|
query remote users as part of the search.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,14 @@
|
||||||
"type": "m.room.topic",
|
"type": "m.room.topic",
|
||||||
"state_key": "",
|
"state_key": "",
|
||||||
"content": {
|
"content": {
|
||||||
"topic": "A room topic"
|
"m.topic": {
|
||||||
|
"m.text": [ {
|
||||||
|
"mimetype": "text/html",
|
||||||
|
"body": "An <em>interesting</em> room topic"
|
||||||
|
}, {
|
||||||
|
"body": "An interesting room topic"
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
"topic": "An interesting room topic"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
type: array
|
||||||
|
description: |-
|
||||||
|
An ordered array of textual representations in different mimetypes.
|
||||||
|
|
||||||
|
Senders SHOULD specify at least one representation and SHOULD always
|
||||||
|
include a plaintext representation.
|
||||||
|
|
||||||
|
Receivers SHOULD use the first representation in the array that
|
||||||
|
they understand.
|
||||||
|
title: TextContentBlock
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
title: TextualRepresentation
|
||||||
|
properties:
|
||||||
|
mimetype:
|
||||||
|
type: string
|
||||||
|
description: The mimetype. Defaults to `text/plain` if omitted.
|
||||||
|
example: "text/html"
|
||||||
|
body:
|
||||||
|
type: string
|
||||||
|
description: |-
|
||||||
|
The string content.
|
||||||
|
|
||||||
|
Clients SHOULD validate and sanitize the content as they do
|
||||||
|
for rich content associated with [`msgtype`](/client-server-api/#mroommessage-msgtypes)
|
||||||
|
of [`m.room.message`](/client-server-api/#mroommessage).
|
||||||
|
required:
|
||||||
|
- body
|
||||||
|
|
@ -2,19 +2,40 @@
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: core-event-schema/state_event.yaml
|
- $ref: core-event-schema/state_event.yaml
|
||||||
description: |-
|
description: |-
|
||||||
A topic is a short message detailing what is currently being discussed in the room.
|
A topic is a short message detailing what is currently being discussed
|
||||||
It can also be used as a way to display extra information about the room, which may not
|
in the room. It can also be used as a way to display extra information
|
||||||
be suitable for the room name.
|
about the room, which may not be suitable for the room name. The room
|
||||||
The room topic can also be set when creating a room using `/createRoom` with the `topic` key.'
|
topic can also be set when creating a room using
|
||||||
|
[`/createRoom`](client-server-api/#post_matrixclientv3createroom), either
|
||||||
|
with the `topic` key or by specifying a full event in `initial_state`.
|
||||||
|
|
||||||
If the `topic` property is absent, null, or empty then the topic is unset. In other words,
|
If the `topic` property is absent, null, or empty then the topic is unset. In other words,
|
||||||
an empty `topic` property effectively resets the room to having no topic.
|
an empty `topic` property effectively resets the room to having no topic.
|
||||||
|
|
||||||
|
In order to prevent formatting abuse in room topics, clients SHOULD
|
||||||
|
limit the length of topics during both entry and display, for instance,
|
||||||
|
by capping the number of displayed lines. Additionally, clients SHOULD
|
||||||
|
ignore things like headings and enumerations (or format them as regular
|
||||||
|
text).
|
||||||
properties:
|
properties:
|
||||||
content:
|
content:
|
||||||
properties:
|
properties:
|
||||||
topic:
|
topic:
|
||||||
description: The topic text.
|
description: |-
|
||||||
|
The topic in plain text.
|
||||||
|
|
||||||
|
This SHOULD duplicate the content of the `text/plain`
|
||||||
|
representation in `m.topic` if any exists.
|
||||||
type: string
|
type: string
|
||||||
|
m.topic:
|
||||||
|
type: object
|
||||||
|
title: TopicContentBlock
|
||||||
|
x-addedInMatrixVersion: "1.15"
|
||||||
|
description: |-
|
||||||
|
Textual representation of the room topic in different mimetypes.
|
||||||
|
properties:
|
||||||
|
m.text:
|
||||||
|
$ref: components/m_text_content_block.yaml
|
||||||
required:
|
required:
|
||||||
- topic
|
- topic
|
||||||
type: object
|
type: object
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue