matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.82k stars 2.13k forks source link

Allow spam checkers to override the error message #16259

Open gabrc52 opened 1 year ago

gabrc52 commented 1 year ago

Description:

For instance in user_may_join_room

image

It is currently possible to override the status code / error code but not the error message. It would be useful for plugin devs to specify to users trying to join a room why they were denied for the room and what they can do in order to be granted access.

Clients like Element can then then display that error message.

clokep commented 1 year ago

It looks like #13044 almost allows this, but it only lets you return additional fields, the message is hard-coded:

https://github.com/matrix-org/synapse/blob/62a1a9be52f4bc79b112f9841ddb3d03b8efccba/synapse/handlers/room_member.py#L945