From 36bedb6c6afeb652ac75b72db634dde05af2797f Mon Sep 17 00:00:00 2001 From: babolivier Date: Wed, 20 Oct 2021 11:04:56 +0000 Subject: deploy: 78d5896d19692e4b6cdbf09f807915e6b0929ce5 --- develop/modules/spam_checker_callbacks.html | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'develop/modules/spam_checker_callbacks.html') diff --git a/develop/modules/spam_checker_callbacks.html b/develop/modules/spam_checker_callbacks.html index f43444d402..2bb382af2a 100644 --- a/develop/modules/spam_checker_callbacks.html +++ b/develop/modules/spam_checker_callbacks.html @@ -189,6 +189,7 @@ Synapse instances. Spam checker callbacks can be registered using the module API

Callbacks

The available spam checker callbacks are:

check_event_for_spam

+

First introduced in Synapse v1.37.0

async def check_event_for_spam(event: "synapse.events.EventBase") -> Union[bool, str]
 

Called when receiving an event from a client or via federation. The module can return @@ -200,6 +201,7 @@ callback returns False, Synapse falls through to the next one. The callback that does not return False will be used. If this happens, Synapse will not call any of the subsequent implementations of this callback.

user_may_join_room

+

First introduced in Synapse v1.37.0

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 @@ -214,6 +216,7 @@ callback returns True, Synapse falls through to the next one. The v callback that does not return True will be used. If this happens, Synapse will not call any of the subsequent implementations of this callback.

user_may_invite

+

First introduced in Synapse v1.37.0

async def user_may_invite(inviter: str, invitee: str, room_id: str) -> bool
 

Called when processing an invitation. The module must return a bool indicating whether @@ -224,6 +227,7 @@ callback returns True, Synapse falls through to the next one. The v callback that does not return True will be used. If this happens, Synapse will not call any of the subsequent implementations of this callback.

user_may_send_3pid_invite

+

First introduced in Synapse v1.45.0

async def user_may_send_3pid_invite(
     inviter: str,
     medium: str,
@@ -254,6 +258,7 @@ callback returns True, Synapse falls through to the next one. The v
 callback that does not return True will be used. If this happens, Synapse will not call
 any of the subsequent implementations of this callback.

user_may_create_room

+

First introduced in Synapse v1.37.0

async def user_may_create_room(user: str) -> bool
 

Called when processing a room creation request. The module must return a bool indicating @@ -263,6 +268,7 @@ callback returns True, Synapse falls through to the next one. The v callback that does not return True will be used. If this happens, Synapse will not call any of the subsequent implementations of this callback.

user_may_create_room_with_invites

+

First introduced in Synapse v1.44.0

async def user_may_create_room_with_invites(
     user: str,
     invites: List[str],
@@ -288,6 +294,7 @@ callback returns True, Synapse falls through to the next one. The v
 callback that does not return True will be used. If this happens, Synapse will not call
 any of the subsequent implementations of this callback.

user_may_create_room_alias

+

First introduced in Synapse v1.37.0

async def user_may_create_room_alias(user: str, room_alias: "synapse.types.RoomAlias") -> bool
 

Called when trying to associate an alias with an existing room. The module must return a @@ -298,6 +305,7 @@ callback returns True, Synapse falls through to the next one. The v callback that does not return True will be used. If this happens, Synapse will not call any of the subsequent implementations of this callback.

user_may_publish_room

+

First introduced in Synapse v1.37.0

async def user_may_publish_room(user: str, room_id: str) -> bool
 

Called when trying to publish a room to the homeserver's public rooms directory. The @@ -308,6 +316,7 @@ callback returns True, Synapse falls through to the next one. The v callback that does not return True will be used. If this happens, Synapse will not call any of the subsequent implementations of this callback.

check_username_for_spam

+

First introduced in Synapse v1.37.0

async def check_username_for_spam(user_profile: Dict[str, str]) -> bool
 

Called when computing search results in the user directory. The module must return a @@ -325,6 +334,7 @@ callback returns False, Synapse falls through to the next one. The callback that does not return False will be used. If this happens, Synapse will not call any of the subsequent implementations of this callback.

check_registration_for_spam

+

First introduced in Synapse v1.37.0

async def check_registration_for_spam(
     email_threepid: Optional[dict],
     username: Optional[str],
@@ -351,6 +361,7 @@ The value of the first callback that does not return RegistrationBehaviour
 be used. If this happens, Synapse will not call any of the subsequent implementations of
 this callback.

check_media_file_for_spam

+

First introduced in Synapse v1.37.0

async def check_media_file_for_spam(
     file_wrapper: "synapse.rest.media.v1.media_storage.ReadableFileWrapper",
     file_info: "synapse.rest.media.v1._base.FileInfo",
-- 
cgit 1.5.1