mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-07-02 12:17:47 +02:00
Add event examples and address review comments
Signed-off-by: jpcshka <189279532+jpcshka@users.noreply.github.com>
This commit is contained in:
parent
e48ded062f
commit
38d83b75b8
|
|
@ -57,6 +57,8 @@ when creating or editing image packs.
|
|||
|
||||
{{% event event="m.room.image_pack" %}}
|
||||
|
||||
#### Account data
|
||||
|
||||
{{% event event="m.image_pack.rooms" %}}
|
||||
|
||||
#### 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
|
||||
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
|
||||
|
||||
Clients SHOULD surface image packs defined in the canonical space of the
|
||||
|
|
|
|||
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.
|
||||
Each entry defines one image available in this pack.
|
||||
type: object
|
||||
propertyNames:
|
||||
type: string
|
||||
pattern: '^[A-Za-z0-9_-]{1,100}$'
|
||||
additionalProperties:
|
||||
title: ImagePackImage
|
||||
type: object
|
||||
|
|
|
|||
Loading…
Reference in a new issue