Improvements to CS API "Instant messaging" module (#2370)

This commit is contained in:
Kévin Commaille 2026-05-05 11:42:18 +02:00 committed by GitHub
parent 0baab558ed
commit ec24e73db1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 34 additions and 6 deletions

View file

@ -0,0 +1 @@
Clarify formats of string types.

View file

@ -197,7 +197,7 @@ To ensure this is done consistently across clients, clients SHOULD use
the following algorithm to calculate a disambiguated display name for a the following algorithm to calculate a disambiguated display name for a
given user: given user:
1. Inspect the `m.room.member` state event for the relevant user id. 1. Inspect the [`m.room.member`](#mroommember) state event for the relevant user id.
2. If the `m.room.member` state event has no `displayname` field, or if 2. If the `m.room.member` state event has no `displayname` field, or if
that field has a `null` value, use the raw user id as the display that field has a `null` value, use the raw user id as the display
name. Otherwise: name. Otherwise:

View file

@ -22,6 +22,8 @@ properties:
description: |- description: |-
The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) to a thumbnail of the image. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) to a thumbnail of the image.
type: string type: string
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
thumbnail_info: thumbnail_info:
allOf: allOf:
- $ref: thumbnail_info.yaml - $ref: thumbnail_info.yaml

View file

@ -23,6 +23,8 @@ properties:
The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) to a thumbnail of the image. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) to a thumbnail of the image.
Only present if the thumbnail is unencrypted. Only present if the thumbnail is unencrypted.
type: string type: string
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
thumbnail_file: thumbnail_file:
description: |- description: |-
Information on the encrypted thumbnail file, as specified in Information on the encrypted thumbnail file, as specified in

View file

@ -16,6 +16,8 @@ properties:
The URL to the image. If this property is not present, the room has no avatar. This can be useful The URL to the image. If this property is not present, the room has no avatar. This can be useful
to remove a previous room avatar. to remove a previous room avatar.
type: string type: string
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
type: object type: object
state_key: state_key:
description: A zero-length string. description: A zero-length string.

View file

@ -54,6 +54,8 @@ properties:
Required if the file is unencrypted. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) Required if the file is unencrypted. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris))
to the audio clip. to the audio clip.
type: string type: string
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
file: file:
description: |- description: |-
Required if the file is encrypted. Information on the encrypted Required if the file is encrypted. Information on the encrypted

View file

@ -44,6 +44,8 @@ properties:
The URL to the thumbnail of the file. Only present if the The URL to the thumbnail of the file. Only present if the
thumbnail is unencrypted. thumbnail is unencrypted.
type: string type: string
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
thumbnail_file: thumbnail_file:
description: |- description: |-
Information on the encrypted thumbnail file, as specified in Information on the encrypted thumbnail file, as specified in
@ -66,6 +68,8 @@ properties:
Required if the file is unencrypted. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) Required if the file is unencrypted. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris))
to the file. to the file.
type: string type: string
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
file: file:
description: |- description: |-
Required if the file is encrypted. Information on the encrypted Required if the file is encrypted. Information on the encrypted

View file

@ -44,6 +44,8 @@ properties:
Required if the file is unencrypted. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) Required if the file is unencrypted. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris))
to the image. to the image.
type: string type: string
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
file: file:
description: |- description: |-
Required if the file is encrypted. Information on the encrypted Required if the file is encrypted. Information on the encrypted

View file

@ -13,6 +13,8 @@ properties:
geo_uri: geo_uri:
description: A [geo URI (RFC5870)](https://datatracker.ietf.org/doc/html/rfc5870) representing this location. description: A [geo URI (RFC5870)](https://datatracker.ietf.org/doc/html/rfc5870) representing this location.
type: string type: string
format: uri
pattern: "^geo:"
msgtype: msgtype:
enum: enum:
- m.location - m.location
@ -25,6 +27,8 @@ properties:
The URL to a thumbnail of the location being represented. The URL to a thumbnail of the location being represented.
Only present if the thumbnail is unencrypted. Only present if the thumbnail is unencrypted.
type: string type: string
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
thumbnail_file: thumbnail_file:
description: |- description: |-
Information on the encrypted thumbnail file, as specified in Information on the encrypted thumbnail file, as specified in

View file

@ -54,6 +54,8 @@ properties:
The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) to an image thumbnail of The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) to an image thumbnail of
the video clip. Only present if the thumbnail is unencrypted. the video clip. Only present if the thumbnail is unencrypted.
type: string type: string
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
thumbnail_file: thumbnail_file:
description: |- description: |-
Information on the encrypted thumbnail file, as specified in Information on the encrypted thumbnail file, as specified in
@ -76,6 +78,8 @@ properties:
Required if the file is unencrypted. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris)) Required if the file is unencrypted. The URL (typically [`mxc://` URI](/client-server-api/#matrix-content-mxc-uris))
to the video clip. to the video clip.
type: string type: string
format: mx-mxc-uri
pattern: "^mxc:\\/\\/"
file: file:
description: |- description: |-
Required if the file is encrypted. Information on the encrypted Required if the file is encrypted. Information on the encrypted

View file

@ -4,16 +4,19 @@ $schema: https://json-schema.org/draft/2020-12/schema
allOf: allOf:
- $ref: core-event-schema/state_event.yaml - $ref: core-event-schema/state_event.yaml
description: |- description: |-
A room has an opaque room ID which is not human-friendly to read. A room A room has an opaque [room ID](/appendices#room-ids) which is not
alias is human-friendly, but not all rooms have room aliases. The room name human-friendly to read. A [room alias](appendices#room-aliases) is
is a human-friendly string designed to be displayed to the end-user. The human-friendly, but not all rooms have [room aliases](/client-server-api/#room-aliases).
room name is not unique, as multiple rooms can have the same room name set. The room name is a human-friendly string designed to be displayed to the
end-user. The room name is not unique, as multiple rooms can have the same
room name set.
If a room has an `m.room.name` event with an absent, null, or empty `name` If a room has an `m.room.name` event with an absent, null, or empty `name`
field, it should be treated the same as a room with no `m.room.name` event. field, it should be treated the same as a room with no `m.room.name` event.
An event of this type is automatically created when creating a room using An event of this type is automatically created when creating a room using
`/createRoom` with the `name` key. [`/createRoom`](/client-server-api/#post_matrixclientv3createroom) with the
`name` key.
properties: properties:
content: content:
properties: properties:

View file

@ -11,6 +11,8 @@ properties:
description: An ordered list of event IDs to pin. description: An ordered list of event IDs to pin.
items: items:
type: string type: string
format: mx-event-id
pattern: "^\\$"
type: array type: array
required: required:
- pinned - pinned