forked from matrix-org/matrix-spec-proposals
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: * matrix-org#1524 * matrix-org#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 matrix-org#1524 Fixes matrix-org#630 Step towards https://github.com/matrix-org/matrix-doc/issues/1530
- Loading branch information
Showing
45 changed files
with
175 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"content": { | ||
"key": "value" | ||
}, | ||
"type": "org.example.custom.event" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"$ref": "event.json", | ||
"room_id": "!jEsUZKDJdhlrceRyVU:domain.com" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"$ref": "room_event.json", | ||
"state_key": "ArbitraryString" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
{ | ||
"age": 242352, | ||
"$ref": "core/room_event.json", | ||
"type": "m.call.hangup", | ||
"content": { | ||
"version" : 0, | ||
"call_id": "12345" | ||
}, | ||
"origin_server_ts": 1431961217939, | ||
"event_id": "$WLGTSEFSEF:localhost", | ||
"type": "m.call.hangup", | ||
"room_id": "!Cuyf34gef24t:localhost", | ||
"sender": "@example:localhost" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
{ | ||
"$ref": "core/event.json", | ||
"type": "m.direct", | ||
"content": { | ||
"@bob:example.com": [ | ||
"!abcdefgh:example.com", | ||
"!hgfedcba:example.com" | ||
] | ||
"!abcdefgh:example.com", | ||
"!hgfedcba:example.com" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"$ref": "core/event.json", | ||
"type": "m.ignored_user_list", | ||
"content": { | ||
"ignored_users": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
{ | ||
"$ref": "core/event.json", | ||
"sender": "@example:localhost", | ||
"type": "m.presence", | ||
"content": { | ||
"avatar_url": "mxc://localhost:wefuiwegh8742w", | ||
"last_active_ago": 2478593, | ||
"presence": "online", | ||
"currently_active": false | ||
}, | ||
"sender": "@example:localhost", | ||
"type": "m.presence" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
{ | ||
"type": "m.receipt", | ||
"room_id": "!KpjVgQyZpzBwvMBsnT:matrix.org", | ||
"content": { | ||
"$1435641916114394fHBLK:matrix.org": { | ||
"m.read": { | ||
"@rikj:jki.re": { | ||
"ts": 1436451550453 | ||
} | ||
} | ||
"$ref": "core/room_edu.json", | ||
"type": "m.receipt", | ||
"content": { | ||
"$1435641916114394fHBLK:matrix.org": { | ||
"m.read": { | ||
"@rikj:jki.re": { | ||
"ts": 1436451550453 | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
{ | ||
"age": 242352, | ||
"content": { | ||
"aliases": ["#somewhere:localhost", "#another:localhost"] | ||
}, | ||
"state_key": "localhost", | ||
"origin_server_ts": 1431961217939, | ||
"event_id": "$WLGTSEFSEF:localhost", | ||
"$ref": "core/state_event.json", | ||
"state_key": "domain.com", | ||
"type": "m.room.aliases", | ||
"room_id": "!Cuyf34gef24t:localhost", | ||
"sender": "@example:localhost" | ||
"content": { | ||
"aliases": ["#somewhere:domain.com", "#another:domain.com"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
{ | ||
"age": 242352, | ||
"$ref": "core/state_event.json", | ||
"type": "m.room.avatar", | ||
"state_key": "", | ||
"content": { | ||
"info": { | ||
"h": 398, | ||
"w": 394, | ||
"mimetype": "image/jpeg", | ||
"size": 31037 | ||
}, | ||
"url": "mxc://localhost/JWEIFJgwEIhweiWJE" | ||
}, | ||
"origin_server_ts": 1431961217939, | ||
"event_id": "$WLGTSEFSEF:localhost", | ||
"type": "m.room.avatar", | ||
"state_key": "", | ||
"room_id": "!Cuyf34gef24t:localhost", | ||
"sender": "@example:localhost" | ||
"url": "mxc://domain.com/JWEIFJgwEIhweiWJE" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
{ | ||
"age": 242352, | ||
"$ref": "core/state_event.json", | ||
"type": "m.room.canonical_alias", | ||
"state_key": "", | ||
"content": { | ||
"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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
{ | ||
"age": 242352, | ||
"content": { | ||
"creator": "@example:localhost" | ||
}, | ||
"state_key": "", | ||
"origin_server_ts": 1431961217939, | ||
"event_id": "$WLGTSEFSEF:localhost", | ||
"$ref": "core/state_event.json", | ||
"type": "m.room.create", | ||
"room_id": "!Cuyf34gef24t:localhost", | ||
"sender": "@example:localhost" | ||
"state_key": "", | ||
"content": { | ||
"creator": "@example:domain.com", | ||
"room_version": "1", | ||
"m.federate": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
{ | ||
"$ref": "core/room_event.json", | ||
"type": "m.room.encrypted", | ||
"content": { | ||
"algorithm": "m.megolm.v1.aes-sha2", | ||
"ciphertext": "AwgAEnACgAkLmt6qF84IK++J7UDH2Za1YVchHyprqTqsg...", | ||
"device_id": "RJYKSTBOIE", | ||
"sender_key": "IlRMeOPX2e0MurIyfWEucYBRVOEEUMrOHqn/8mLqMjA", | ||
"session_id": "X3lUlvLELLYxeTx4yOVu6UDpasGEVO0Jbu+QFnm0cKQ" | ||
}, | ||
"event_id": "$WLGTSEFSEF:localhost", | ||
"room_id": "!Cuyf34gef24t:localhost", | ||
"origin_server_ts": 1476648761524, | ||
"sender": "@example:localhost", | ||
"type": "m.room.encrypted" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
{ | ||
"$ref": "core/state_event.json", | ||
"type": "m.room.encryption", | ||
"state_key": "", | ||
"content": { | ||
"algorithm": "m.megolm.v1.aes-sha2", | ||
"rotation_period_ms": 604800000, | ||
"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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
{ | ||
"age": 242353, | ||
"$ref": "core/state_event.json", | ||
"type": "m.room.guest_access", | ||
"state_key": "", | ||
"content": { | ||
"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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
{ | ||
"age": 242352, | ||
"$ref": "core/state_event.json", | ||
"type": "m.room.history_visibility", | ||
"state_key": "", | ||
"content": { | ||
"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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
{ | ||
"age": 242352, | ||
"$ref": "core/state_event.json", | ||
"type": "m.room.join_rules", | ||
"state_key": "", | ||
"content": { | ||
"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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
{ | ||
"age": 242352, | ||
"$ref": "core/state_event.json", | ||
"state_key": "@alice:domain.com", | ||
"type": "m.room.member", | ||
"content": { | ||
"membership": "join", | ||
"avatar_url": "mxc://localhost/SEsfnsuifSDFSSEF#auto", | ||
"avatar_url": "mxc://domain.com/SEsfnsuifSDFSSEF#auto", | ||
"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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.