Merge pull request #113 from matrix-org/invite-room-state

Add invite_room_state to spec
This commit is contained in:
Kegsay 2015-10-21 09:37:44 +01:00
commit 074c7d480c
4 changed files with 42 additions and 11 deletions

View file

@ -20,6 +20,22 @@
"sender": "@zun:zun.soft"
}
},
"invite_room_state": [
{
"type": "m.room.name",
"state_key": "",
"content": {
"name": "Forest of Magic"
}
},
{
"type": "m.room.join_rules",
"state_key": "",
"content": {
"join_rules": "invite"
}
}
],
"state_key": "@alice:localhost",
"origin_server_ts": 1431961217939,
"event_id": "$WLGTSEFSEF:localhost",

View file

@ -1,7 +1,7 @@
{
"type": "object",
"title": "The current membership state of a user in the room.",
"description": "Adjusts the membership state for a user in a room. It is preferable to use the membership APIs (``/rooms/<room id>/invite`` etc) when performing membership actions rather than adjusting the state directly as there are a restricted set of valid transformations. For example, user A cannot force user B to join a room, and trying to force this state change directly will fail. The ``third_party_invite`` property will be set if the invite was an ``m.room.third_party_invite`` event, and absent if the invite was an ``m.room.member`` event.",
"description": "Adjusts the membership state for a user in a room. It is preferable to use the membership APIs (``/rooms/<room id>/invite`` etc) when performing membership actions rather than adjusting the state directly as there are a restricted set of valid transformations. For example, user A cannot force user B to join a room, and trying to force this state change directly will fail. \n\nThe ``third_party_invite`` property will be set if the invite was an ``m.room.third_party_invite`` event, and absent if the invite was an ``m.room.member`` event.\n\nThis event also includes an ``invite_room_state`` key **outside the** ``content`` **key**. This contains an array of ``StrippedState`` Events. These events provide information on a few select state events such as the room name.",
"allOf": [{
"$ref": "core-event-schema/state_event.json"
}],
@ -24,7 +24,7 @@
},
"third_party_invite": {
"type": "object",
"title": "invite",
"title": "Invite",
"properties": {
"token": {
"type": "string",
@ -81,17 +81,23 @@
"description": "A subset of the state of the room at the time of the invite, if ``membership`` is ``invite``",
"items": {
"type": "object",
"title": "StateEvent",
"title": "StrippedState",
"description": "A stripped down state event, with only the ``type``, ``state_key`` and ``content`` keys.",
"required": ["type", "state_key", "content"],
"properties": {
"type": {
"type": "string"
"type": "string",
"description": "The ``type`` for the event.",
"enum": ["m.room.join_rules", "m.room.canonical_alias", "m.room.avatar", "m.room.name"]
},
"state_key": {
"type": "string"
"type": "string",
"description": "The ``state_key`` for the event."
},
"content": {
"type": "object"
"title": "EventContent",
"type": "object",
"description": "The ``content`` for the event."
}
}
}