Add event examples and address review comments

Signed-off-by: jpcshka <189279532+jpcshka@users.noreply.github.com>
This commit is contained in:
jpcshka 2026-06-24 19:30:31 +03:00
parent e48ded062f
commit 38d83b75b8
No known key found for this signature in database
GPG key ID: ACD395A54EA0AEAE
4 changed files with 65 additions and 0 deletions

View file

@ -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

View file

@ -0,0 +1,15 @@
{
"$ref": "core/event.json",
"type": "m.image_pack.rooms",
"content": {
"rooms": {
"!someroom:example.org": {
"": {}
},
"!anotherroom:example.org": {
"": {},
"sticker_pack": {}
}
}
}
}

View 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"
}
}
}

View file

@ -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