mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-02-24 23:13:42 +01: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 run get-proposals
|
||||
- name: "⚙️ hugo"
|
||||
env:
|
||||
HUGO_PARAMS_VERSION_STATUS: "historical"
|
||||
# Create a baseURL like `/v1.2` out of the `v1.2` tag
|
||||
run: |
|
||||
echo -e '[params.version]\nstatus="historical"' > historical.toml
|
||||
hugo --config config.toml,historical.toml --baseURL "/${GITHUB_REF/refs\/tags\//}" -d "spec"
|
||||
hugo --baseURL "/${GITHUB_REF/refs\/tags\//}" -d "spec"
|
||||
|
||||
- name: "📥 Spec definition download"
|
||||
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
|
||||
|
||||
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 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
|
||||
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
|
||||
for their own account maintenance:
|
||||
|
||||
* [PUT /profile/{userId}/displayname](#put_matrixclientv3profileuseriddisplayname)
|
||||
* [PUT /profile/{userId}/{key_name}](#put_matrixclientv3profileuseridkeyname)
|
||||
* [GET /devices](#get_matrixclientv3devices)
|
||||
* [GET /devices/{deviceId}](#get_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.
|
||||
|
||||
Moderation policy lists are stored as room state events. There are no
|
||||
restrictions on how the rooms can be configured (they could be public,
|
||||
private, encrypted, etc).
|
||||
restrictions on how the rooms can be configured in terms of
|
||||
[join rules](#mroomjoin_rules), [history visibility](#room-history-visibility),
|
||||
encryption, etc.
|
||||
|
||||
There are currently 3 kinds of entities which can be affected by rules:
|
||||
`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
|
||||
|
||||
Presence information is shared with all users who share a room with the
|
||||
target user. In large public rooms this could be undesirable.
|
||||
Presence information is published to all users who share a room with the
|
||||
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:
|
||||
|
||||
- `content.body` in `m.room.message`
|
||||
- `content.name` in `m.room.name`
|
||||
- `content.topic` in `m.room.topic`
|
||||
- `content.body` in [`m.room.message`](/client-server-api/#mroommessage)
|
||||
- `content.name` in [`m.room.name`](/client-server-api/#mroomname)
|
||||
- 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.
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
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
|
||||
absent or equal to their user's Matrix ID, however they should evaluate whether or not to ring based on their
|
||||
user's trust relationship with the callers and/or where the call was placed. As a starting point, it is
|
||||
suggested that clients ignore call invites from users in public rooms. It is strongly recommended that
|
||||
when clients do not ring for an incoming call invite, they still display the call invite in the room and
|
||||
Clients should consider an incoming call if they see a non-expired invite event
|
||||
where the `invitee` field is either absent or equal to their user's Matrix ID.
|
||||
They should, however, evaluate whether or not to ring based on their user's trust
|
||||
relationship with the callers and/or where the call was placed. As a starting
|
||||
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.
|
||||
|
||||
##### Glare
|
||||
|
|
|
|||
|
|
@ -544,8 +544,8 @@ the following subset of the room state:
|
|||
`third_party_invite` property, the current
|
||||
`m.room.third_party_invite` event with `state_key` matching
|
||||
`content.third_party_invite.signed.token`, if any.
|
||||
- If `content.join_authorised_via_users_server` is present,
|
||||
and the [room version supports restricted rooms](/rooms/#feature-matrix),
|
||||
- If `membership` is `join`, `content.join_authorised_via_users_server`
|
||||
is present, and the [room version supports restricted rooms](/rooms/#feature-matrix),
|
||||
then the `m.room.member` event with `state_key` matching
|
||||
`content.join_authorised_via_users_server`.
|
||||
|
||||
|
|
|
|||
|
|
@ -73,11 +73,17 @@ paths:
|
|||
- default
|
||||
- available
|
||||
m.set_displayname:
|
||||
deprecated: true
|
||||
$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:
|
||||
deprecated: true
|
||||
$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:
|
||||
$ref: '#/components/schemas/booleanCapability'
|
||||
description: Capability to indicate if the user can change 3PID associations
|
||||
|
|
@ -86,6 +92,37 @@ paths:
|
|||
$ref: '#/components/schemas/booleanCapability'
|
||||
description: Capability to indicate if the user can generate tokens to log further
|
||||
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:
|
||||
response:
|
||||
value: {
|
||||
|
|
|
|||
|
|
@ -109,15 +109,17 @@ paths:
|
|||
name:
|
||||
type: string
|
||||
description: |-
|
||||
If this is included, an `m.room.name` event will be sent
|
||||
into the room to indicate the name of the room. See Room
|
||||
Events for more information on `m.room.name`.
|
||||
If this is included, an [`m.room.name`](/client-server-api/#mroomname) event
|
||||
will be sent into the room to indicate the name for the room.
|
||||
This overwrites any [`m.room.name`](/client-server-api/#mroomname)
|
||||
event in `initial_state`.
|
||||
topic:
|
||||
type: string
|
||||
description: |-
|
||||
If this is included, an `m.room.topic` event will be sent
|
||||
into the room to indicate the topic for the room. See Room
|
||||
Events for more information on `m.room.topic`.
|
||||
If this is included, an [`m.room.topic`](/client-server-api/#mroomtopic)
|
||||
event with a `text/plain` mimetype will be sent into the room
|
||||
to indicate the topic for the room. This overwrites any
|
||||
[`m.room.topic`](/client-server-api/#mroomtopic) event in `initial_state`.
|
||||
invite:
|
||||
type: array
|
||||
description: |-
|
||||
|
|
|
|||
|
|
@ -33,7 +33,9 @@ properties:
|
|||
example: "!abcdefg:example.org"
|
||||
topic:
|
||||
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"
|
||||
world_readable:
|
||||
type: boolean
|
||||
|
|
|
|||
|
|
@ -16,48 +16,105 @@ info:
|
|||
title: Matrix Client-Server Profile API
|
||||
version: 1.0.0
|
||||
paths:
|
||||
"/profile/{userId}/displayname":
|
||||
"/profile/{userId}/{keyName}":
|
||||
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: |-
|
||||
This API sets the given user's display name. You must have permission to
|
||||
set this user's display name, e.g. you need to have their `access_token`.
|
||||
operationId: setDisplayName
|
||||
Set or update a profile field for a user. Must be authenticated with an
|
||||
access token authorised to make changes. Servers may impose size limits
|
||||
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:
|
||||
- accessTokenQuery: []
|
||||
- accessTokenBearer: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: userId
|
||||
description: The user whose display name to set.
|
||||
description: The user whose profile field to set.
|
||||
required: true
|
||||
example: "@alice:example.com"
|
||||
schema:
|
||||
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:
|
||||
description: A JSON object containing the property whose name matches
|
||||
the `keyName` specified in the URL. See `additionalProperties` for
|
||||
further details.
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
example: {
|
||||
"displayname": "Alice Margatroid"
|
||||
}
|
||||
properties:
|
||||
displayname:
|
||||
type: string
|
||||
description: The new display name for this user.
|
||||
description: The new display name information.
|
||||
required: true
|
||||
minProperties: 1
|
||||
additionalProperties:
|
||||
description: The JSON object must include a property whose key
|
||||
matches the `keyName` specified in the URL. For `avatar_url`,
|
||||
the value must be an MXC URI string. For `displayname`, the value
|
||||
must be a string. For custom keys, any JSON type is allowed -
|
||||
servers may not validate these values, but clients should follow
|
||||
the format defined for that key.
|
||||
example: { "displayname": "Alice Wonderland" }
|
||||
responses:
|
||||
"200":
|
||||
description: The display name was set.
|
||||
description: The profile field was set.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object # empty json object
|
||||
type: object # empty JSON object
|
||||
examples:
|
||||
response:
|
||||
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":
|
||||
description: This request was rate-limited.
|
||||
content:
|
||||
|
|
@ -67,98 +124,133 @@ paths:
|
|||
tags:
|
||||
- User data
|
||||
get:
|
||||
summary: Get the user's display name.
|
||||
description: |-
|
||||
Get the user's display name. This API may be used to fetch the user's
|
||||
own displayname or to query the name of other users; either locally or
|
||||
on remote homeservers.
|
||||
operationId: getDisplayName
|
||||
x-changedInMatrixVersion:
|
||||
"1.14": Endpoint now accepts variable `keyName` parameter.
|
||||
summary: Get a profile field for a user.
|
||||
description: Get the value of a profile field for a user. Any individual
|
||||
field must be within the total profile limit of 64 KiB.
|
||||
operationId: getProfileField
|
||||
parameters:
|
||||
- in: path
|
||||
name: userId
|
||||
description: The user whose display name to get.
|
||||
description: The user whose profile field to get.
|
||||
required: true
|
||||
example: "@alice:example.com"
|
||||
schema:
|
||||
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:
|
||||
"200":
|
||||
description: The display name for this user.
|
||||
description: The profile field value was retrieved.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
displayname:
|
||||
type: string
|
||||
description: The user's display name if they have set one, otherwise not
|
||||
present.
|
||||
minProperties: 1
|
||||
additionalProperties:
|
||||
description: The JSON response includes a property whose key
|
||||
matches the `keyName` specified in the URL. For `avatar_url`,
|
||||
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:
|
||||
response:
|
||||
value: {
|
||||
"displayname": "Alice Margatroid"
|
||||
}
|
||||
value: { "displayname": "Alice" }
|
||||
"403":
|
||||
x-addedInMatrixVersion: "1.12"
|
||||
description: The server is unwilling to disclose whether the user exists and/or
|
||||
has a display name.
|
||||
description: The server is unwilling to disclose whether the user
|
||||
exists and/or has the specified profile field.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: definitions/errors/error.yaml
|
||||
examples:
|
||||
response:
|
||||
value: {
|
||||
"errcode": "M_FORBIDDEN",
|
||||
"error": "Profile lookup is disabled on this homeserver"
|
||||
}
|
||||
value:
|
||||
{
|
||||
"errcode": "M_FORBIDDEN",
|
||||
"error": "Profile lookup is disabled on this homeserver",
|
||||
}
|
||||
"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:
|
||||
- User data
|
||||
"/profile/{userId}/avatar_url":
|
||||
put:
|
||||
summary: Set the user's avatar URL.
|
||||
description: |-
|
||||
This API sets the given user's avatar URL. You must have permission to
|
||||
set this user's avatar URL, e.g. you need to have their `access_token`.
|
||||
operationId: setAvatarUrl
|
||||
delete:
|
||||
x-addedInMatrixVersion: "1.14"
|
||||
summary: Remove a profile field from a user.
|
||||
description: Remove a specific field from a user's profile.
|
||||
operationId: deleteProfileField
|
||||
security:
|
||||
- accessTokenQuery: []
|
||||
- accessTokenBearer: []
|
||||
parameters:
|
||||
- in: path
|
||||
name: userId
|
||||
description: The user whose avatar URL to set.
|
||||
description: The user whose profile field to delete.
|
||||
required: true
|
||||
example: "@alice:example.com"
|
||||
schema:
|
||||
type: string
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
example: {
|
||||
"avatar_url": "mxc://matrix.org/wefh34uihSDRGhw34"
|
||||
}
|
||||
properties:
|
||||
avatar_url:
|
||||
type: string
|
||||
format: uri
|
||||
description: The new avatar URL for this user.
|
||||
description: The new avatar information.
|
||||
required: true
|
||||
- in: path
|
||||
name: keyName
|
||||
description: The profile field key name to delete. 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:
|
||||
"200":
|
||||
description: The avatar URL was set.
|
||||
description: The profile field was deleted.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object # empty json object
|
||||
type: object
|
||||
examples:
|
||||
response:
|
||||
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":
|
||||
description: This request was rate-limited.
|
||||
content:
|
||||
|
|
@ -167,63 +259,15 @@ paths:
|
|||
$ref: definitions/errors/rate_limited.yaml
|
||||
tags:
|
||||
- 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}":
|
||||
get:
|
||||
summary: Get this user's profile information.
|
||||
summary: Get all profile information for a user.
|
||||
description: |-
|
||||
Get the combined profile information for this user. This API may be used
|
||||
to fetch the user's own profile information or other users; either
|
||||
locally or on remote homeservers.
|
||||
Get the complete profile for a user. The response includes `avatar_url`
|
||||
and `displayname` (unless set to `null`, as they can only be strings)
|
||||
plus any custom profile fields.
|
||||
|
||||
**Note**: The complete profile must be under 64 KiB.
|
||||
operationId: getUserProfile
|
||||
parameters:
|
||||
- in: path
|
||||
|
|
@ -243,45 +287,49 @@ paths:
|
|||
properties:
|
||||
avatar_url:
|
||||
type: string
|
||||
format: uri
|
||||
description: The user's avatar URL if they have set one, otherwise not present.
|
||||
format: mx-mxc-uri
|
||||
description: "Avatar URL value (MXC URI format)."
|
||||
displayname:
|
||||
type: string
|
||||
description: The user's display name if they have set one, otherwise not
|
||||
present.
|
||||
additionalProperties:
|
||||
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:
|
||||
response:
|
||||
value: {
|
||||
"avatar_url": "mxc://matrix.org/SDGdghriugerRg",
|
||||
"displayname": "Alice Margatroid"
|
||||
}
|
||||
value:
|
||||
{
|
||||
"avatar_url": "mxc://matrix.org/SDGdghriugerRg",
|
||||
"displayname": "Alice Margatroid",
|
||||
"m.example_field": "custom_value",
|
||||
}
|
||||
"403":
|
||||
x-addedInMatrixVersion: "1.2"
|
||||
description: The server is unwilling to disclose whether the user exists and/or
|
||||
has profile information.
|
||||
description: The server is unwilling to disclose whether the user
|
||||
exists and/or has profile information.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: definitions/errors/error.yaml
|
||||
examples:
|
||||
response:
|
||||
value: {
|
||||
"errcode": "M_FORBIDDEN",
|
||||
"error": "Profile lookup is disabled on this homeserver"
|
||||
}
|
||||
value:
|
||||
{
|
||||
"errcode": "M_FORBIDDEN",
|
||||
"error": "Profile lookup is disabled on this homeserver",
|
||||
}
|
||||
"404":
|
||||
description: There is no profile information for this user or this user does not
|
||||
exist.
|
||||
description: There is no profile information for this user or this
|
||||
user does not exist.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: definitions/errors/error.yaml
|
||||
examples:
|
||||
response:
|
||||
value: {
|
||||
"errcode": "M_NOT_FOUND",
|
||||
"error": "Profile not found"
|
||||
}
|
||||
value:
|
||||
{ "errcode": "M_NOT_FOUND", "error": "Profile not found" }
|
||||
tags:
|
||||
- User data
|
||||
servers:
|
||||
|
|
|
|||
|
|
@ -20,10 +20,17 @@ paths:
|
|||
post:
|
||||
summary: Searches the user directory.
|
||||
description: |-
|
||||
Performs a search for users. The homeserver may
|
||||
determine which subset of users are searched, however the homeserver
|
||||
MUST at a minimum consider the users the requesting user shares a
|
||||
room with and those who reside in public rooms (known to the homeserver).
|
||||
Performs a search for users. The homeserver may determine which
|
||||
subset of users are searched. However, the homeserver MUST at a
|
||||
minimum consider 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 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
|
||||
query remote users as part of the search.
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,14 @@
|
|||
"type": "m.room.topic",
|
||||
"state_key": "",
|
||||
"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
|
||||
|
|
@ -1,20 +1,41 @@
|
|||
---
|
||||
allOf:
|
||||
- $ref: core-event-schema/state_event.yaml
|
||||
description: |-
|
||||
A topic is a short message detailing what is currently being discussed in the room.
|
||||
It can also be used as a way to display extra information about the room, which may not
|
||||
be suitable for the room name.
|
||||
The room topic can also be set when creating a room using `/createRoom` with the `topic` key.'
|
||||
|
||||
description: |-
|
||||
A topic is a short message detailing what is currently being discussed
|
||||
in the room. It can also be used as a way to display extra information
|
||||
about the room, which may not be suitable for the room name. The room
|
||||
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,
|
||||
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:
|
||||
content:
|
||||
properties:
|
||||
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
|
||||
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:
|
||||
- topic
|
||||
type: object
|
||||
|
|
|
|||
Loading…
Reference in a new issue