Fix client-server event schemas: remove `age`, dedupe fields

This commit adds support for event schema examples to have references to help reduce the chance of fields being forgotten. This also helps reduce duplication of fields, allowing for a more consistent spec that uses the same values everywhere.

This also removes both `unsigned` and `age` from the examples as per:
* https://github.com/matrix-org/matrix-doc/issues/1524
* https://github.com/matrix-org/matrix-doc/issues/630

Finally, this replaces "localhost" in the examples with an example domain. This is really just a nitpick thing on my part where seeing a "real world" domain is preferred. 

Fixes https://github.com/matrix-org/matrix-doc/issues/1524
Fixes https://github.com/matrix-org/matrix-doc/issues/630
Step towards https://github.com/matrix-org/matrix-doc/issues/1530
pull/1558/head
Travis Ralston 6 years ago
parent 5f06694b6f
commit 0f28f83270

@ -0,0 +1,6 @@
{
"content": {
"key": "value"
},
"type": "org.example.custom.event"
}

@ -0,0 +1,4 @@
{
"$ref": "event.json",
"room_id": "!jEsUZKDJdhlrceRyVU:domain.com"
}

@ -0,0 +1,7 @@
{
"$ref": "event.json",
"event_id": "$143273582443PhrSn:domain.com",
"room_id": "!jEsUZKDJdhlrceRyVU:domain.com",
"sender": "@example:domain.com",
"origin_server_ts": 1432735824653
}

@ -0,0 +1,4 @@
{
"$ref": "room_event.json",
"state_key": "ArbitraryString"
}

@ -1,5 +1,6 @@
{ {
"age": 242352, "$ref": "core/room_event.json",
"type": "m.call.answer",
"content": { "content": {
"version" : 0, "version" : 0,
"call_id": "12345", "call_id": "12345",
@ -8,10 +9,5 @@
"type" : "answer", "type" : "answer",
"sdp" : "v=0\r\no=- 6584580628695956864 2 IN IP4 127.0.0.1[...]" "sdp" : "v=0\r\no=- 6584580628695956864 2 IN IP4 127.0.0.1[...]"
} }
}, }
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.call.answer",
"room_id": "!Cuyf34gef24t:localhost",
"sender": "@example:localhost"
} }

@ -1,5 +1,6 @@
{ {
"age": 242352, "$ref": "core/room_event.json",
"type": "m.call.candidates",
"content": { "content": {
"version" : 0, "version" : 0,
"call_id": "12345", "call_id": "12345",
@ -10,10 +11,5 @@
"candidate": "candidate:863018703 1 udp 2122260223 10.9.64.156 43670 typ host generation 0" "candidate": "candidate:863018703 1 udp 2122260223 10.9.64.156 43670 typ host generation 0"
} }
] ]
}, }
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.call.candidates",
"room_id": "!Cuyf34gef24t:localhost",
"sender": "@example:localhost"
} }

@ -1,12 +1,8 @@
{ {
"age": 242352, "$ref": "core/room_event.json",
"type": "m.call.hangup",
"content": { "content": {
"version" : 0, "version" : 0,
"call_id": "12345" "call_id": "12345"
}, }
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.call.hangup",
"room_id": "!Cuyf34gef24t:localhost",
"sender": "@example:localhost"
} }

@ -1,5 +1,6 @@
{ {
"age": 242352, "$ref": "core/room_event.json",
"type": "m.call.invite",
"content": { "content": {
"version" : 0, "version" : 0,
"call_id": "12345", "call_id": "12345",
@ -8,10 +9,5 @@
"type" : "offer", "type" : "offer",
"sdp" : "v=0\r\no=- 6584580628695956864 2 IN IP4 127.0.0.1[...]" "sdp" : "v=0\r\no=- 6584580628695956864 2 IN IP4 127.0.0.1[...]"
} }
}, }
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.call.invite",
"room_id": "!Cuyf34gef24t:localhost",
"sender": "@example:localhost"
} }

@ -1,9 +1,10 @@
{ {
"$ref": "core/event.json",
"type": "m.direct", "type": "m.direct",
"content": { "content": {
"@bob:example.com": [ "@bob:example.com": [
"!abcdefgh:example.com", "!abcdefgh:example.com",
"!hgfedcba:example.com" "!hgfedcba:example.com"
] ]
} }
} }

@ -1,4 +1,5 @@
{ {
"$ref": "core/event.json",
"type": "m.ignored_user_list", "type": "m.ignored_user_list",
"content": { "content": {
"ignored_users": { "ignored_users": {

@ -1,10 +1,11 @@
{ {
"$ref": "core/event.json",
"sender": "@example:localhost",
"type": "m.presence",
"content": { "content": {
"avatar_url": "mxc://localhost:wefuiwegh8742w", "avatar_url": "mxc://localhost:wefuiwegh8742w",
"last_active_ago": 2478593, "last_active_ago": 2478593,
"presence": "online", "presence": "online",
"currently_active": false "currently_active": false
}, }
"sender": "@example:localhost",
"type": "m.presence"
} }

@ -1,13 +1,13 @@
{ {
"type": "m.receipt", "$ref": "core/room_edu.json",
"room_id": "!KpjVgQyZpzBwvMBsnT:matrix.org", "type": "m.receipt",
"content": { "content": {
"$1435641916114394fHBLK:matrix.org": { "$1435641916114394fHBLK:matrix.org": {
"m.read": { "m.read": {
"@rikj:jki.re": { "@rikj:jki.re": {
"ts": 1436451550453 "ts": 1436451550453
}
}
} }
}
} }
}
} }

@ -1,12 +1,8 @@
{ {
"age": 242352, "$ref": "core/state_event.json",
"content": { "state_key": "domain.com",
"aliases": ["#somewhere:localhost", "#another:localhost"]
},
"state_key": "localhost",
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.room.aliases", "type": "m.room.aliases",
"room_id": "!Cuyf34gef24t:localhost", "content": {
"sender": "@example:localhost" "aliases": ["#somewhere:domain.com", "#another:domain.com"]
}
} }

@ -1,5 +1,7 @@
{ {
"age": 242352, "$ref": "core/state_event.json",
"type": "m.room.avatar",
"state_key": "",
"content": { "content": {
"info": { "info": {
"h": 398, "h": 398,
@ -7,12 +9,6 @@
"mimetype": "image/jpeg", "mimetype": "image/jpeg",
"size": 31037 "size": 31037
}, },
"url": "mxc://localhost/JWEIFJgwEIhweiWJE" "url": "mxc://domain.com/JWEIFJgwEIhweiWJE"
}, }
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.room.avatar",
"state_key": "",
"room_id": "!Cuyf34gef24t:localhost",
"sender": "@example:localhost"
} }

@ -1,12 +1,8 @@
{ {
"age": 242352, "$ref": "core/state_event.json",
"type": "m.room.canonical_alias",
"state_key": "",
"content": { "content": {
"alias": "#somewhere:localhost" "alias": "#somewhere:localhost"
}, }
"state_key": "",
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.room.canonical_alias",
"room_id": "!Cuyf34gef24t:localhost",
"sender": "@example:localhost"
} }

@ -1,12 +1,10 @@
{ {
"age": 242352, "$ref": "core/state_event.json",
"content": {
"creator": "@example:localhost"
},
"state_key": "",
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.room.create", "type": "m.room.create",
"room_id": "!Cuyf34gef24t:localhost", "state_key": "",
"sender": "@example:localhost" "content": {
"creator": "@example:domain.com",
"room_version": "1",
"m.federate": true
}
} }

@ -1,14 +1,11 @@
{ {
"$ref": "core/room_event.json",
"type": "m.room.encrypted",
"content": { "content": {
"algorithm": "m.megolm.v1.aes-sha2", "algorithm": "m.megolm.v1.aes-sha2",
"ciphertext": "AwgAEnACgAkLmt6qF84IK++J7UDH2Za1YVchHyprqTqsg...", "ciphertext": "AwgAEnACgAkLmt6qF84IK++J7UDH2Za1YVchHyprqTqsg...",
"device_id": "RJYKSTBOIE", "device_id": "RJYKSTBOIE",
"sender_key": "IlRMeOPX2e0MurIyfWEucYBRVOEEUMrOHqn/8mLqMjA", "sender_key": "IlRMeOPX2e0MurIyfWEucYBRVOEEUMrOHqn/8mLqMjA",
"session_id": "X3lUlvLELLYxeTx4yOVu6UDpasGEVO0Jbu+QFnm0cKQ" "session_id": "X3lUlvLELLYxeTx4yOVu6UDpasGEVO0Jbu+QFnm0cKQ"
}, }
"event_id": "$WLGTSEFSEF:localhost",
"room_id": "!Cuyf34gef24t:localhost",
"origin_server_ts": 1476648761524,
"sender": "@example:localhost",
"type": "m.room.encrypted"
} }

@ -1,6 +1,6 @@
{ {
"$ref": "core/room_event.json",
"type": "m.room.encrypted", "type": "m.room.encrypted",
"sender": "@example:localhost",
"content": { "content": {
"algorithm": "m.olm.v1.curve25519-aes-sha2", "algorithm": "m.olm.v1.curve25519-aes-sha2",
"sender_key": "Szl29ksW/L8yZGWAX+8dY1XyFi+i5wm+DRhTGkbMiwU", "sender_key": "Szl29ksW/L8yZGWAX+8dY1XyFi+i5wm+DRhTGkbMiwU",

@ -1,13 +1,10 @@
{ {
"$ref": "core/state_event.json",
"type": "m.room.encryption",
"state_key": "",
"content": { "content": {
"algorithm": "m.megolm.v1.aes-sha2", "algorithm": "m.megolm.v1.aes-sha2",
"rotation_period_ms": 604800000, "rotation_period_ms": 604800000,
"rotation_period_msgs": 100 "rotation_period_msgs": 100
}, }
"event_id": "$WLGTSEFJJKJ:localhost",
"origin_server_ts": 1476648761524,
"sender": "@example:localhost",
"room_id": "!Cuyf34gef24t:localhost",
"state_key": "",
"type": "m.room.encryption"
} }

@ -1,12 +1,8 @@
{ {
"age": 242353, "$ref": "core/state_event.json",
"type": "m.room.guest_access",
"state_key": "",
"content": { "content": {
"guest_access": "can_join" "guest_access": "can_join"
}, }
"state_key": "",
"origin_server_ts": 1431961217938,
"event_id": "$WLGTSEFSEG:localhost",
"type": "m.room.guest_access",
"room_id": "!Cuyf34gef24u:localhost",
"sender": "@example:localhost"
} }

@ -1,12 +1,8 @@
{ {
"age": 242352, "$ref": "core/state_event.json",
"type": "m.room.history_visibility",
"state_key": "",
"content": { "content": {
"history_visibility": "shared" "history_visibility": "shared"
}, }
"state_key": "",
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.room.history_visibility",
"room_id": "!Cuyf34gef24t:localhost",
"sender": "@example:localhost"
} }

@ -1,12 +1,8 @@
{ {
"age": 242352, "$ref": "core/state_event.json",
"type": "m.room.join_rules",
"state_key": "",
"content": { "content": {
"join_rule": "public" "join_rule": "public"
}, }
"state_key": "",
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.room.join_rules",
"room_id": "!Cuyf34gef24t:localhost",
"sender": "@example:localhost"
} }

@ -1,14 +1,10 @@
{ {
"age": 242352, "$ref": "core/state_event.json",
"state_key": "@alice:domain.com",
"type": "m.room.member",
"content": { "content": {
"membership": "join", "membership": "join",
"avatar_url": "mxc://localhost/SEsfnsuifSDFSSEF#auto", "avatar_url": "mxc://domain.com/SEsfnsuifSDFSSEF#auto",
"displayname": "Alice Margatroid" "displayname": "Alice Margatroid"
}, }
"state_key": "@alice:localhost",
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.room.member",
"room_id": "!Cuyf34gef24t:localhost",
"sender": "@example:localhost"
} }

@ -1,8 +1,8 @@
{ {
"age": 242352, "$ref": "m.room.member",
"content": { "content": {
"membership": "invite", "membership": "invite",
"avatar_url": "mxc://localhost/SEsfnsuifSDFSSEF#auto", "avatar_url": "mxc://domain.com/SEsfnsuifSDFSSEF#auto",
"displayname": "Alice Margatroid" "displayname": "Alice Margatroid"
}, },
"invite_room_state": [ "invite_room_state": [
@ -20,11 +20,5 @@
"join_rule": "invite" "join_rule": "invite"
} }
} }
], ]
"state_key": "@alice:localhost",
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.room.member",
"room_id": "!Cuyf34gef24t:localhost",
"sender": "@example:localhost"
} }

@ -1,13 +1,13 @@
{ {
"age": 242352, "$ref": "m.room.member",
"content": { "content": {
"membership": "invite", "membership": "invite",
"avatar_url": "mxc://localhost/SEsfnsuifSDFSSEF#auto", "avatar_url": "mxc://domain.com/SEsfnsuifSDFSSEF#auto",
"displayname": "Alice Margatroid", "displayname": "Alice Margatroid",
"third_party_invite": { "third_party_invite": {
"display_name": "alice", "display_name": "alice",
"signed": { "signed": {
"mxid": "@alice:localhost", "mxid": "@alice:domain.com",
"signatures": { "signatures": {
"magic.forest": { "magic.forest": {
"ed25519:3": "fQpGIW1Snz+pwLZu6sTy2aHy/DYWWTspTJRPyNp0PKkymfIsNffysMl6ObMMFdIJhk6g6pwlIqZ54rxo8SLmAg" "ed25519:3": "fQpGIW1Snz+pwLZu6sTy2aHy/DYWWTspTJRPyNp0PKkymfIsNffysMl6ObMMFdIJhk6g6pwlIqZ54rxo8SLmAg"
@ -16,11 +16,5 @@
"token": "abc123" "token": "abc123"
} }
} }
}, }
"state_key": "@alice:localhost",
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.room.member",
"room_id": "!Cuyf34gef24t:localhost",
"sender": "@example:localhost"
} }

@ -1,18 +1,14 @@
{ {
"age": 146, "$ref": "core/room_event.json",
"type": "m.room.message",
"content": { "content": {
"body": "Bee Gees - Stayin' Alive", "body": "Bee Gees - Stayin' Alive",
"url": "mxc://localhost/ffed755USFFxlgbQYZGtryd", "url": "mxc://domain.com/ffed755USFFxlgbQYZGtryd",
"info": { "info": {
"duration": 2140786, "duration": 2140786,
"size": 1563685, "size": 1563685,
"mimetype": "audio/mpeg" "mimetype": "audio/mpeg"
}, },
"msgtype": "m.audio" "msgtype": "m.audio"
}, }
"event_id": "$143273582443PhrSn:localhost",
"origin_server_ts": 1432735824653,
"room_id": "!jEsUZKDJdhlrceRyVU:localhost",
"type": "m.room.message",
"sender": "@example:localhost"
} }

@ -1,14 +1,10 @@
{ {
"age": 242352, "$ref": "core/room_event.json",
"type": "m.room.message",
"content": { "content": {
"body": "thinks this is an example emote", "body": "thinks this is an example emote",
"msgtype": "m.emote", "msgtype": "m.emote",
"format": "org.matrix.custom.html", "format": "org.matrix.custom.html",
"formatted_body": "thinks <b>this</b> is an example emote" "formatted_body": "thinks <b>this</b> is an example emote"
}, }
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.room.message",
"room_id": "!Cuyf34gef24t:localhost",
"sender": "@example:localhost"
} }

@ -1,5 +1,6 @@
{ {
"age": 146, "$ref": "core/room_event.json",
"type": "m.room.message",
"content": { "content": {
"body": "something-important.doc", "body": "something-important.doc",
"filename": "something-important.doc", "filename": "something-important.doc",
@ -8,11 +9,6 @@
"size": 46144 "size": 46144
}, },
"msgtype": "m.file", "msgtype": "m.file",
"url": "mxc://localhost/FHyPlCeYUSFFxlgbQYZmoEoe" "url": "mxc://domain.com/FHyPlCeYUSFFxlgbQYZmoEoe"
}, }
"event_id": "$143273582443PhrSn:localhost",
"origin_server_ts": 1432735824653,
"room_id": "!jEsUZKDJdhlrceRyVU:localhost",
"type": "m.room.message",
"sender": "@example:localhost"
} }

@ -1,5 +1,6 @@
{ {
"age": 242352, "$ref": "core/room_event.json",
"type": "m.room.message",
"content": { "content": {
"body": "filename.jpg", "body": "filename.jpg",
"info": { "info": {
@ -8,12 +9,7 @@
"mimetype": "image/jpeg", "mimetype": "image/jpeg",
"size": 31037 "size": 31037
}, },
"url": "mxc://localhost/JWEIFJgwEIhweiWJE", "url": "mxc://domain.com/JWEIFJgwEIhweiWJE",
"msgtype": "m.image" "msgtype": "m.image"
}, }
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.room.message",
"room_id": "!Cuyf34gef24t:localhost",
"sender": "@example:localhost"
} }

@ -1,10 +1,11 @@
{ {
"age": 146, "$ref": "core/room_event.json",
"type": "m.room.message",
"content": { "content": {
"body": "Big Ben, London, UK", "body": "Big Ben, London, UK",
"geo_uri": "geo:51.5008,0.1247", "geo_uri": "geo:51.5008,0.1247",
"info": { "info": {
"thumbnail_url": "mxc://localhost/FHyPlCeYUSFFxlgbQYZmoEoe", "thumbnail_url": "mxc://domain.com/FHyPlCeYUSFFxlgbQYZmoEoe",
"thumbnail_info": { "thumbnail_info": {
"mimetype": "image/jpeg", "mimetype": "image/jpeg",
"size": 46144, "size": 46144,
@ -13,10 +14,5 @@
} }
}, },
"msgtype": "m.location" "msgtype": "m.location"
}, }
"event_id": "$143273582443PhrSn:localhost",
"origin_server_ts": 1432735824653,
"room_id": "!jEsUZKDJdhlrceRyVU:localhost",
"type": "m.room.message",
"sender": "@example:localhost"
} }

@ -1,12 +1,8 @@
{ {
"age": 242352, "$ref": "core/room_event.json",
"type": "m.room.message",
"content": { "content": {
"body": "This is an example notice", "body": "This is an example notice",
"msgtype": "m.notice" "msgtype": "m.notice"
}, }
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.room.message",
"room_id": "!Cuyf34gef24t:localhost",
"sender": "@example:localhost"
} }

@ -1,14 +1,10 @@
{ {
"age": 242352, "$ref": "core/room_event.json",
"type": "m.room.message",
"content": { "content": {
"body": "This is an example text message", "body": "This is an example text message",
"msgtype": "m.text", "msgtype": "m.text",
"format": "org.matrix.custom.html", "format": "org.matrix.custom.html",
"formatted_body": "<b>This is an example text message</b>" "formatted_body": "<b>This is an example text message</b>"
}, }
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.room.message",
"room_id": "!Cuyf34gef24t:localhost",
"sender": "@example:localhost"
} }

@ -1,10 +1,11 @@
{ {
"age": 146, "$ref": "core/room_event.json",
"type": "m.room.message",
"content": { "content": {
"body": "Gangnam Style", "body": "Gangnam Style",
"url": "mxc://localhost/a526eYUSFFxlgbQYZmo442", "url": "mxc://domain.com/a526eYUSFFxlgbQYZmo442",
"info": { "info": {
"thumbnail_url": "mxc://localhost/FHyPlCeYUSFFxlgbQYZmoEoe", "thumbnail_url": "mxc://domain.com/FHyPlCeYUSFFxlgbQYZmoEoe",
"thumbnail_info": { "thumbnail_info": {
"mimetype": "image/jpeg", "mimetype": "image/jpeg",
"size": 46144, "size": 46144,
@ -18,10 +19,5 @@
"mimetype": "video/mp4" "mimetype": "video/mp4"
}, },
"msgtype": "m.video" "msgtype": "m.video"
}, }
"event_id": "$143273582443PhrSn:localhost",
"origin_server_ts": 1432735824653,
"room_id": "!jEsUZKDJdhlrceRyVU:localhost",
"type": "m.room.message",
"sender": "@example:localhost"
} }

@ -1,12 +1,8 @@
{ {
"age": 242352, "$ref": "core/room_event.json",
"type": "m.room.message.feedback",
"content": { "content": {
"type": "delivered", "type": "delivered",
"target_event_id": "$WEIGFHFW:localhost" "target_event_id": "$WEIGFHFW:localhost"
}, }
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.room.message.feedback",
"room_id": "!Cuyf34gef24t:localhost",
"sender": "@example:localhost"
} }

@ -1,12 +1,8 @@
{ {
"age": 242352, "$ref": "core/state_event.json",
"type": "m.room.name",
"state_key": "",
"content": { "content": {
"name": "The room name" "name": "The room name"
}, }
"state_key": "",
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.room.name",
"room_id": "!Cuyf34gef24t:localhost",
"sender": "@example:localhost"
} }

@ -1,12 +1,8 @@
{ {
"age": 242352, "$ref": "core/state_event.json",
"content": {
"pinned": ["$someevent:localhost"]
},
"state_key": "",
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.room.pinned_events", "type": "m.room.pinned_events",
"room_id": "!Cuyf34gef24t:localhost", "state_key": "",
"sender": "@example:localhost" "content": {
"pinned": ["$someevent:domain.com"]
}
} }

@ -1,5 +1,7 @@
{ {
"age": 242352, "$ref": "core/state_event.json",
"type": "m.room.power_levels",
"state_key": "",
"content": { "content": {
"ban": 50, "ban": 50,
"events": { "events": {
@ -15,11 +17,5 @@
"@example:localhost": 100 "@example:localhost": 100
}, },
"users_default": 0 "users_default": 0
}, }
"state_key": "",
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.room.power_levels",
"room_id": "!Cuyf34gef24t:localhost",
"sender": "@example:localhost"
} }

@ -1,14 +1,8 @@
{ {
"unsigned": { "$ref": "core/room_event.json",
"age": 242352
},
"content": {
"reason": "Spamming"
},
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.room.redaction", "type": "m.room.redaction",
"room_id": "!Cuyf34gef24t:localhost",
"redacts": "$fukweghifu23:localhost", "redacts": "$fukweghifu23:localhost",
"sender": "@example:localhost" "content": {
"reason": "Spamming"
}
} }

@ -1,5 +1,7 @@
{ {
"age": 242352, "$ref": "core/state_event.json",
"type": "m.room.third_party_invite",
"state_key": "pc98",
"content": { "content": {
"display_name": "Alice Margatroid", "display_name": "Alice Margatroid",
"key_validity_url": "https://magic.forest/verifykey", "key_validity_url": "https://magic.forest/verifykey",
@ -8,11 +10,5 @@
"public_key": "def456", "public_key": "def456",
"key_validity_url": "https://magic.forest/verifykey" "key_validity_url": "https://magic.forest/verifykey"
}] }]
}, }
"state_key": "pc98",
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.room.third_party_invite",
"room_id": "!Cuyf34gef24t:localhost",
"sender": "@example:localhost"
} }

@ -1,12 +1,8 @@
{ {
"age": 242352, "$ref": "core/state_event.json",
"type": "m.room.topic",
"state_key": "",
"content": { "content": {
"topic": "A room topic" "topic": "A room topic"
}, }
"state_key": "",
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.room.topic",
"room_id": "!Cuyf34gef24t:localhost",
"sender": "@example:localhost"
} }

@ -1,9 +1,10 @@
{ {
"$ref": "core/event.json",
"type": "m.room_key",
"content": { "content": {
"algorithm": "m.megolm.v1.aes-sha2", "algorithm": "m.megolm.v1.aes-sha2",
"room_id": "!Cuyf34gef24t:localhost", "room_id": "!Cuyf34gef24t:localhost",
"session_id": "X3lUlvLELLYxeTx4yOVu6UDpasGEVO0Jbu+QFnm0cKQ", "session_id": "X3lUlvLELLYxeTx4yOVu6UDpasGEVO0Jbu+QFnm0cKQ",
"session_key": "AgAAAADxKHa9uFxcXzwYoNueL5Xqi69IkD4sni8LlfJL7qNBEY..." "session_key": "AgAAAADxKHa9uFxcXzwYoNueL5Xqi69IkD4sni8LlfJL7qNBEY..."
}, }
"type": "m.room_key"
} }

@ -1,5 +1,6 @@
{ {
"age": 242352, "$ref": "core/room_event.json",
"type": "m.sticker",
"content": { "content": {
"body": "Landing", "body": "Landing",
"info": { "info": {
@ -16,10 +17,5 @@
"size": 73602 "size": 73602
}, },
"url": "mxc://matrix.org/sHhqkFCvSkFwtmvtETOtKnLP" "url": "mxc://matrix.org/sHhqkFCvSkFwtmvtETOtKnLP"
}, }
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",
"type": "m.sticker",
"room_id": "!Cuyf34gef24t:localhost",
"sender": "@example:localhost"
} }

@ -1,4 +1,5 @@
{ {
"$ref": "core/event.json",
"type": "m.tag", "type": "m.tag",
"content": { "content": {
"tags": { "tags": {

@ -1,7 +1,7 @@
{ {
"type": "m.typing", "$ref": "core/room_edu.json",
"room_id": "!z0mnsuiwhifuhwwfw:matrix.org", "type": "m.typing",
"content": { "content": {
"user_ids": ["@alice:matrix.org", "@bob:example.com"] "user_ids": ["@alice:matrix.org", "@bob:example.com"]
} }
} }

@ -792,7 +792,7 @@ class MatrixUnits(Units):
logger.info("Reading event example: %s" % filepath) logger.info("Reading event example: %s" % filepath)
try: try:
with open(filepath, "r") as f: with open(filepath, "r") as f:
example = json.load(f) example = resolve_references(filepath, json.load(f))
examples[filename] = examples.get(filename, []) examples[filename] = examples.get(filename, [])
examples[filename].append(example) examples[filename].append(example)
if filename != event_name: if filename != event_name:

Loading…
Cancel
Save