mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-08-04 23:17:48 +02:00
Compare commits
8 commits
f2386c1588
...
38d83b75b8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38d83b75b8 | ||
|
|
e48ded062f | ||
|
|
2f213b907e | ||
|
|
de6f6d2e74 | ||
|
|
3f08ea8425 | ||
|
|
02edbc2622 | ||
|
|
5a1bba322d | ||
|
|
6fcbb8ea93 |
|
|
@ -8,7 +8,7 @@ collections and share them with others.
|
||||||
An **emoticon** (also called an emote) is a custom image sent inline within a
|
An **emoticon** (also called an emote) is a custom image sent inline within a
|
||||||
message, analogous to emoji but defined outside the Unicode standard. A
|
message, analogous to emoji but defined outside the Unicode standard. A
|
||||||
**sticker** is a standalone image sent as an [`m.sticker`](#msticker) event.
|
**sticker** is a standalone image sent as an [`m.sticker`](#msticker) event.
|
||||||
Image packs provide a distribution mechanism for both.
|
Image packs provide a distribution and discovery mechanism for both.
|
||||||
|
|
||||||
{{% boxes/note %}}
|
{{% boxes/note %}}
|
||||||
Emoticons are distinct from the [`m.emote`](#mroommessage-msgtypes) message
|
Emoticons are distinct from the [`m.emote`](#mroommessage-msgtypes) message
|
||||||
|
|
@ -34,7 +34,7 @@ Where `ALPHA` and `DIGIT` are as defined in
|
||||||
[RFC 5234](https://datatracker.ietf.org/doc/html/rfc5234). Shortcodes are
|
[RFC 5234](https://datatracker.ietf.org/doc/html/rfc5234). Shortcodes are
|
||||||
case-sensitive. The length of a shortcode MUST NOT exceed 100 bytes.
|
case-sensitive. The length of a shortcode MUST NOT exceed 100 bytes.
|
||||||
|
|
||||||
The `:` character is excluded because it is widely used across messaging
|
The `:` character is specifically excluded because it is widely used across messaging
|
||||||
platforms as a delimiter for triggering emote search (for example, typing
|
platforms as a delimiter for triggering emote search (for example, typing
|
||||||
`:cat` to search for an emote named `cat`). The `/` character is excluded
|
`:cat` to search for an emote named `cat`). The `/` character is excluded
|
||||||
because clients MAY use it to separate a shortcode from a pack name in
|
because clients MAY use it to separate a shortcode from a pack name in
|
||||||
|
|
@ -57,6 +57,8 @@ when creating or editing image packs.
|
||||||
|
|
||||||
{{% event event="m.room.image_pack" %}}
|
{{% event event="m.room.image_pack" %}}
|
||||||
|
|
||||||
|
#### Account data
|
||||||
|
|
||||||
{{% event event="m.image_pack.rooms" %}}
|
{{% event event="m.image_pack.rooms" %}}
|
||||||
|
|
||||||
#### Image properties
|
#### Image properties
|
||||||
|
|
@ -82,6 +84,22 @@ To make a room's image pack available globally across all rooms, a user adds
|
||||||
a reference to the pack in their `m.image_pack.rooms` account data event. The
|
a reference to the pack in their `m.image_pack.rooms` account data event. The
|
||||||
reference consists of the room ID and the `state_key` of the pack.
|
reference consists of the room ID and the `state_key` of the pack.
|
||||||
|
|
||||||
|
For example, to enable two packs from different rooms:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"rooms": {
|
||||||
|
"!someroom:example.org": {
|
||||||
|
"": {}
|
||||||
|
},
|
||||||
|
"!anotherroom:example.org": {
|
||||||
|
"": {},
|
||||||
|
"sticker_pack": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
#### Space image packs
|
#### Space image packs
|
||||||
|
|
||||||
Clients SHOULD surface image packs defined in the canonical space of the
|
Clients SHOULD surface image packs defined in the canonical space of the
|
||||||
|
|
@ -100,7 +118,7 @@ packs in the following order:
|
||||||
2. Packs defined in the current room's state.
|
2. Packs defined in the current room's state.
|
||||||
3. Packs from the canonical space hierarchy of the current room.
|
3. Packs from the canonical space hierarchy of the current room.
|
||||||
|
|
||||||
The ordering of images *within* a pack is left to a future specification.
|
The ordering of images *within* a pack is currently up to implementations.
|
||||||
|
|
||||||
#### Client behaviour
|
#### Client behaviour
|
||||||
|
|
||||||
|
|
@ -140,7 +158,7 @@ The `title` attribute SHOULD be present and set to the shortcode of the
|
||||||
emote. Clients MAY display this as a tooltip.
|
emote. Clients MAY display this as a tooltip.
|
||||||
|
|
||||||
The `height` attribute MUST be present for backwards compatibility with
|
The `height` attribute MUST be present for backwards compatibility with
|
||||||
clients that do not support custom emotes. Clients SHOULD set this to `32`.
|
clients that do not support custom emotes. Clients SHOULD set this to "32".
|
||||||
Clients implementing image pack support SHOULD override this value when
|
Clients implementing image pack support SHOULD override this value when
|
||||||
rendering based on the user's font size or other environmental factors. The
|
rendering based on the user's font size or other environmental factors. The
|
||||||
`width` attribute SHOULD be omitted to preserve the image's aspect ratio.
|
`width` attribute SHOULD be omitted to preserve the image's aspect ratio.
|
||||||
|
|
|
||||||
15
data/event-schemas/examples/m.image_pack.rooms.yaml
Normal file
15
data/event-schemas/examples/m.image_pack.rooms.yaml
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"$ref": "core/event.json",
|
||||||
|
"type": "m.image_pack.rooms",
|
||||||
|
"content": {
|
||||||
|
"rooms": {
|
||||||
|
"!someroom:example.org": {
|
||||||
|
"": {}
|
||||||
|
},
|
||||||
|
"!anotherroom:example.org": {
|
||||||
|
"": {},
|
||||||
|
"sticker_pack": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
29
data/event-schemas/examples/m.room.image_pack.yaml
Normal file
29
data/event-schemas/examples/m.room.image_pack.yaml
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
"$ref": "core/state_event.json",
|
||||||
|
"type": "m.room.image_pack",
|
||||||
|
"state_key": "",
|
||||||
|
"content": {
|
||||||
|
"images": {
|
||||||
|
"cat_wave": {
|
||||||
|
"url": "mxc://example.org/abc123",
|
||||||
|
"body": "a waving cat",
|
||||||
|
"info": {
|
||||||
|
"mimetype": "image/png",
|
||||||
|
"w": 512,
|
||||||
|
"h": 512,
|
||||||
|
"size": 84400
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"cat_nap": {
|
||||||
|
"url": "mxc://example.org/def456",
|
||||||
|
"body": "a sleeping cat"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"pack": {
|
||||||
|
"display_name": "Cats",
|
||||||
|
"avatar_url": "mxc://example.org/abc123",
|
||||||
|
"usage": ["emoticon"],
|
||||||
|
"attribution": "drawn by @alice:example.org"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -18,6 +18,9 @@ properties:
|
||||||
A map from a [shortcode](#shortcode-grammar) to an image object.
|
A map from a [shortcode](#shortcode-grammar) to an image object.
|
||||||
Each entry defines one image available in this pack.
|
Each entry defines one image available in this pack.
|
||||||
type: object
|
type: object
|
||||||
|
propertyNames:
|
||||||
|
type: string
|
||||||
|
pattern: '^[A-Za-z0-9_-]{1,100}$'
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
title: ImagePackImage
|
title: ImagePackImage
|
||||||
type: object
|
type: object
|
||||||
|
|
@ -68,7 +71,7 @@ properties:
|
||||||
pattern: "^mxc:\\/\\/"
|
pattern: "^mxc:\\/\\/"
|
||||||
usage:
|
usage:
|
||||||
description: |-
|
description: |-
|
||||||
The intended usages for this pack. The defined values are
|
The intended usage(s) for this pack. The defined values are
|
||||||
`emoticon` (images intended to be sent inline in messages) and
|
`emoticon` (images intended to be sent inline in messages) and
|
||||||
`sticker` (images intended to be sent as standalone sticker
|
`sticker` (images intended to be sent as standalone sticker
|
||||||
events). If absent or empty, all usage types are assumed.
|
events). If absent or empty, all usage types are assumed.
|
||||||
|
|
@ -83,15 +86,14 @@ properties:
|
||||||
- sticker
|
- sticker
|
||||||
attribution:
|
attribution:
|
||||||
description: |-
|
description: |-
|
||||||
An attribution string for the pack, for example crediting the
|
An attribution string for the pack. For crediting the
|
||||||
original author or source.
|
original author or source, for example.
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- images
|
- images
|
||||||
state_key:
|
state_key:
|
||||||
description: |-
|
description: |-
|
||||||
A unique identifier for this image pack within the room. This is not
|
A unique identifier for this image pack within the room.
|
||||||
intended to be surfaced to users.
|
|
||||||
type: string
|
type: string
|
||||||
type:
|
type:
|
||||||
enum:
|
enum:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue