|
| 1 | +# Allowing Reasons in all Membership Events |
| 2 | + |
| 3 | +Currently users can specify a reason for kicking or banning users in a room |
| 4 | +that both the target and other users in a room can see. This is useful to |
| 5 | +explain *why* an action without having to send separate messages. |
| 6 | + |
| 7 | +The proposal extends this to all events, including invites, invite rejections |
| 8 | +and leaves for similar reasons. |
| 9 | + |
| 10 | +## Proposal |
| 11 | + |
| 12 | +Allow `reason` field to be specified for all of the following APIs: |
| 13 | + |
| 14 | +``` |
| 15 | +POST /_matrix/client/r0/rooms/{roomId}/invite |
| 16 | +POST /_matrix/client/r0/rooms/{roomId}/leave |
| 17 | +POST /_matrix/client/r0/rooms/{roomId}/kick |
| 18 | +POST /_matrix/client/r0/rooms/{roomId}/ban |
| 19 | +POST /_matrix/client/r0/rooms/{roomId}/unban |
| 20 | +POST /_matrix/client/r0/rooms/{roomId}/join |
| 21 | +POST /_matrix/client/r0/join/{roomIdOrAlias} |
| 22 | +PUT /_matrix/client/r0/rooms/{roomId}/state/m.room.member/{userID} |
| 23 | +``` |
| 24 | + |
| 25 | +If specified the `reason` field will be added to the generated membership |
| 26 | +event's content. |
| 27 | + |
| 28 | +*Note: `/state/m.room.member` API currently allows this as clients can specify |
| 29 | +arbitrary content already* |
| 30 | + |
| 31 | +Clients may choose to display the reason for membership events in a room, |
| 32 | +though may not do so if e.g. they have collapsed a set of membership changes. |
| 33 | + |
| 34 | +Clients should not display an invite reason by default to the invitee as this |
| 35 | +allows a classic abuse and harassment vector. However, clients may wish to show |
| 36 | +invite reasons from known¹ senders, or have a button that allows viewing any |
| 37 | +invite reason. |
| 38 | + |
| 39 | +## Use Cases |
| 40 | + |
| 41 | +Some basic use cases and examples are given below. |
| 42 | + |
| 43 | +### Kick/ban |
| 44 | + |
| 45 | +Kicking and banning already allow specifying a reason to allow giving a reason |
| 46 | +for the moderation action (e.g. "Banned for spamming"). |
| 47 | + |
| 48 | +### Leaving a Room |
| 49 | + |
| 50 | +A user may wish to leave a room e.g. because the room is no longer relevant |
| 51 | +to them, allowing them to specify a reason means they can easily step out of |
| 52 | +the room quietly without having to send a message to explain their actions. |
| 53 | + |
| 54 | +### Invite |
| 55 | + |
| 56 | +This can be useful to give some context for an invite, e.g. "Alice invites Bob |
| 57 | +to get some feedback on the membership reasons MSC". |
| 58 | + |
| 59 | +### Rejecting an Invite |
| 60 | + |
| 61 | +If Alice has invited Bob (and many others) to a room to discuss going to a |
| 62 | +concert then Bob may wish to simply reject the invite if he can't make it. |
| 63 | +Adding a "will be out of town" reason to the rejection helps Alice to know why |
| 64 | +her invite was rejected. |
| 65 | + |
| 66 | +### Joining room |
| 67 | + |
| 68 | +Adding a reason for joining could be used e.g. by automated bots to say why |
| 69 | +they're joining. For example a bridge bot may join a room when asked to bridge |
| 70 | +the room to an external network, in which case they may have a reason such as |
| 71 | +"BridgeBot joined to bridge the room to RemoteNetwork at the request of Alice". |
| 72 | + |
| 73 | +## Potential Issues |
| 74 | + |
| 75 | +The main issue here is ensuring that the invite reason cannot be used as an |
| 76 | +abuse vector, however if clients follow the recommendations above this concern |
| 77 | +should be mitigated. |
| 78 | + |
| 79 | +--- |
| 80 | + |
| 81 | +¹ This is left up to implementations to decide, if they wish to do so. |
0 commit comments