2015-05-18 18:10:11 +02:00
{
"type": "object",
2015-05-19 17:49:20 +02:00
"title": "The current membership state of a user in the room.",
2015-11-12 11:45:57 +01:00
"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 this invite is an ``invite`` event and is the successor of an ``m.room.third_party_invite`` event, and absent otherwise.\n\nThis event may also include an ``invite_room_state`` key **outside the** ``content`` **key**. If present, this contains an array of ``StrippedState`` Events. These events provide information on a few select state events such as the room name.",
2015-05-18 18:10:11 +02:00
"allOf": [{
2015-09-18 12:39:44 +02:00
"$ref": "core-event-schema/state_event.json"
2015-05-18 18:10:11 +02:00
}],
"properties": {
"content": {
"type": "object",
2015-11-03 20:35:44 +01:00
"title": "EventContent",
2015-05-18 18:10:11 +02:00
"properties": {
"membership": {
"type": "string",
2015-05-21 13:02:07 +02:00
"description": "The membership state of the user.",
2015-05-18 18:28:38 +02:00
"enum": ["invite","join","knock","leave","ban"]
2015-05-19 17:49:20 +02:00
},
"avatar_url": {
2015-05-21 13:02:07 +02:00
"type": "string",
"description": "The avatar URL for this user, if any. This is added by the homeserver."
2015-05-19 17:49:20 +02:00
},
"displayname": {
2015-09-18 18:58:44 +02:00
"type": ["string", "null"],
2015-05-21 13:02:07 +02:00
"description": "The display name for this user, if any. This is added by the homeserver."
2015-10-02 05:19:11 +02:00
},
2015-10-02 15:33:12 +02:00
"third_party_invite": {
"type": "object",
2015-10-16 17:43:33 +02:00
"title": "Invite",
2015-10-02 15:33:12 +02:00
"properties": {
2015-10-16 19:29:20 +02:00
"signed": {
"type": "object",
2015-10-19 13:36:10 +02:00
"title": "signed",
2015-12-04 11:55:18 +01:00
"description": "A block of content which has been signed, which servers can use to verify the event. Clients should ignore this.",
2015-10-16 19:29:20 +02:00
"properties": {
"mxid": {
"type": "string",
"description": "The invited matrix user ID. Must be equal to the user_id property of the event."
},
"token": {
"type": "string",
2015-10-19 13:36:10 +02:00
"description": "The token property of the containing third_party_invite object."
2015-10-16 19:29:20 +02:00
},
"signatures": {
"type": "object",
2015-12-04 11:55:18 +01:00
"description": "A single signature from the verifying server, in the format specified by the Signing Events section of the server-server API.",
2015-10-19 13:36:10 +02:00
"title": "Signatures"
2015-10-16 19:29:20 +02:00
}
2015-10-16 19:56:07 +02:00
},
"required": ["mxid", "signatures", "token"]
2015-10-02 15:33:12 +02:00
}
},
2015-11-05 19:11:20 +01:00
"required": ["signed"]
2015-10-02 15:33:12 +02:00
}
2015-05-18 18:10:11 +02:00
},
"required": ["membership"]
},
"state_key": {
2015-05-21 14:31:08 +02:00
"type": "string",
"description": "The ``user_id`` this membership event relates to."
2015-05-18 18:10:11 +02:00
},
"type": {
"type": "string",
"enum": ["m.room.member"]
2015-09-25 15:21:50 +02:00
},
"invite_room_state": {
"type": "array",
"description": "A subset of the state of the room at the time of the invite, if ``membership`` is ``invite``",
"items": {
"type": "object",
2015-10-16 17:43:33 +02:00
"title": "StrippedState",
2015-09-30 17:11:31 +02:00
"description": "A stripped down state event, with only the ``type``, ``state_key`` and ``content`` keys.",
2015-10-19 14:28:44 +02:00
"required": ["type", "state_key", "content"],
2015-09-25 15:21:50 +02:00
"properties": {
"type": {
2015-10-16 17:43:33 +02:00
"type": "string",
"description": "The ``type`` for the event.",
2015-10-16 17:54:40 +02:00
"enum": ["m.room.join_rules", "m.room.canonical_alias", "m.room.avatar", "m.room.name"]
2015-09-25 15:21:50 +02:00
},
"state_key": {
2015-10-16 17:43:33 +02:00
"type": "string",
"description": "The ``state_key`` for the event."
2015-09-25 15:21:50 +02:00
},
"content": {
2015-10-16 17:43:33 +02:00
"title": "EventContent",
"type": "object",
"description": "The ``content`` for the event."
2015-09-25 15:21:50 +02:00
}
}
}
2015-05-18 18:10:11 +02:00
}
}
}