summary refs log tree commit diff
path: root/docs/modules/spam_checker_callbacks.md
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2021-10-06 16:32:16 +0200
committerGitHub <noreply@github.com>2021-10-06 14:32:16 +0000
commit829f2a82b042d944fef3df55faec924502cdf20d (patch)
tree6e75639dfe1722282f9f1651c0f3df56491f8234 /docs/modules/spam_checker_callbacks.md
parentAdd the synapse-core team as code owners (#10994) (diff)
downloadsynapse-829f2a82b042d944fef3df55faec924502cdf20d.tar.xz
Add a spamchecker callback to allow or deny room joins (#10910)
Co-authored-by: Erik Johnston <erik@matrix.org>
Diffstat (limited to 'docs/modules/spam_checker_callbacks.md')
-rw-r--r--docs/modules/spam_checker_callbacks.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/modules/spam_checker_callbacks.md b/docs/modules/spam_checker_callbacks.md
index 7920ac5f8f..92376df993 100644
--- a/docs/modules/spam_checker_callbacks.md
+++ b/docs/modules/spam_checker_callbacks.md
@@ -19,6 +19,21 @@ either a `bool` to indicate whether the event must be rejected because of spam,
 to indicate the event must be rejected because of spam and to give a rejection reason to
 forward to clients.
 
+### `user_may_join_room`
+
+```python
+async def user_may_join_room(user: str, room: str, is_invited: bool) -> bool
+```
+
+Called when a user is trying to join a room. The module must return a `bool` to indicate
+whether the user can join the room. The user is represented by their Matrix user ID (e.g.
+`@alice:example.com`) and the room is represented by its Matrix ID (e.g.
+`!room:example.com`). The module is also given a boolean to indicate whether the user
+currently has a pending invite in the room.
+
+This callback isn't called if the join is performed by a server administrator, or in the
+context of a room creation.
+
 ### `user_may_invite`
 
 ```python