Add membership reasons to the spec for all membership events

MSC: https://github.com/matrix-org/matrix-doc/pull/2367
pull/977/head
Travis Ralston 4 years ago
parent 561043663f
commit 2d047e312f

@ -61,7 +61,7 @@ paths:
description: The fully qualified user ID of the user being banned. description: The fully qualified user ID of the user being banned.
reason: reason:
type: string type: string
description: The reason the user has been banned. This will be supplied as the description: The reason the user has been banned. This will be supplied as the
``reason`` on the target's updated `m.room.member`_ event. ``reason`` on the target's updated `m.room.member`_ event.
required: ["user_id"] required: ["user_id"]
responses: responses:
@ -111,12 +111,18 @@ paths:
schema: schema:
type: object type: object
example: { example: {
"user_id": "@cheeky_monkey:matrix.org" "user_id": "@cheeky_monkey:matrix.org",
} "reason": "They've been banned long enough"
}
properties: properties:
user_id: user_id:
type: string type: string
description: The fully qualified user ID of the user being unbanned. description: The fully qualified user ID of the user being unbanned.
reason:
type: string
description: |-
Optional reason to be included as the ``reason`` on the subsequent
membership event.
required: ["user_id"] required: ["user_id"]
responses: responses:
200: 200:

@ -67,12 +67,18 @@ paths:
schema: schema:
type: object type: object
example: { example: {
"user_id": "@cheeky_monkey:matrix.org" "user_id": "@cheeky_monkey:matrix.org",
} "reason": "Welcome to the team!"
}
properties: properties:
user_id: user_id:
type: string type: string
description: The fully qualified user ID of the invitee. description: The fully qualified user ID of the invitee.
reason:
type: string
description: |-
Optional reason to be included as the ``reason`` on the subsequent
membership event.
required: ["user_id"] required: ["user_id"]
responses: responses:
200: 200:

@ -52,7 +52,7 @@ paths:
required: true required: true
x-example: "!d41d8cd:matrix.org" x-example: "!d41d8cd:matrix.org"
- in: body - in: body
name: third_party_signed name: body
required: true required: true
schema: schema:
type: object type: object
@ -64,6 +64,12 @@ paths:
If supplied, the homeserver must verify that it matches a pending If supplied, the homeserver must verify that it matches a pending
``m.room.third_party_invite`` event in the room, and perform ``m.room.third_party_invite`` event in the room, and perform
key validity checking if required by the event. key validity checking if required by the event.
reason:
type: string
description: |-
Optional reason to be included as the ``reason`` on the subsequent
membership event.
example: "Looking for support"
responses: responses:
200: 200:
description: |- description: |-
@ -131,7 +137,7 @@ paths:
must be participating in the room. must be participating in the room.
x-example: ["matrix.org", "elsewhere.ca"] x-example: ["matrix.org", "elsewhere.ca"]
- in: body - in: body
name: third_party_signed name: body
required: true required: true
schema: schema:
type: object type: object
@ -143,6 +149,12 @@ paths:
If a ``third_party_signed`` was supplied, the homeserver must verify If a ``third_party_signed`` was supplied, the homeserver must verify
that it matches a pending ``m.room.third_party_invite`` event in the that it matches a pending ``m.room.third_party_invite`` event in the
room, and perform key validity checking if required by the event. room, and perform key validity checking if required by the event.
reason:
type: string
description: |-
Optional reason to be included as the ``reason`` on the subsequent
membership event.
example: "Looking for support"
responses: responses:
200: 200:
description: |- description: |-

@ -52,6 +52,20 @@ paths:
description: The room identifier to leave. description: The room identifier to leave.
required: true required: true
x-example: "!nkl290a:matrix.org" x-example: "!nkl290a:matrix.org"
- in: body
name: body
required: true
schema:
type: object
example: {
"reason": "Saying farewell - thanks for the support!"
}
properties:
reason:
type: string
description: |-
Optional reason to be included as the ``reason`` on the subsequent
membership event.
responses: responses:
200: 200:
description: |- description: |-

@ -5,6 +5,7 @@
"content": { "content": {
"membership": "join", "membership": "join",
"avatar_url": "mxc://example.org/SEsfnsuifSDFSSEF", "avatar_url": "mxc://example.org/SEsfnsuifSDFSSEF",
"displayname": "Alice Margatroid" "displayname": "Alice Margatroid",
"reason": "Looking for support"
} }
} }

@ -3,7 +3,8 @@
"content": { "content": {
"membership": "invite", "membership": "invite",
"avatar_url": "mxc://example.org/SEsfnsuifSDFSSEF", "avatar_url": "mxc://example.org/SEsfnsuifSDFSSEF",
"displayname": "Alice Margatroid" "displayname": "Alice Margatroid",
"reason": "Looking for support"
}, },
"unsigned": { "unsigned": {
"age": 1234, "age": 1234,

@ -67,6 +67,15 @@ properties:
is_direct: is_direct:
description: Flag indicating if the room containing this event was created with the intention of being a direct chat. See `Direct Messaging`_. description: Flag indicating if the room containing this event was created with the intention of being a direct chat. See `Direct Messaging`_.
type: boolean type: boolean
reason:
type: string
description: |-
Optional user-supplied text for why their membership has changed. For kicks and bans, this is typically the reason for the kick or ban.
For other membership changes, this is a way for the user to communicate their intent without having to send a message to the room, such
as in a case where Bob rejects an invite from Alice about an upcoming concert, but can't make it that day.
Clients are not recommended to show this reason to users when receiving an invite due to the potential for spam and abuse. Hiding the
reason behind a button or other component is recommended.
third_party_invite: third_party_invite:
properties: properties:
display_name: display_name:

Loading…
Cancel
Save