From 36bedb6c6afeb652ac75b72db634dde05af2797f Mon Sep 17 00:00:00 2001
From: babolivier The available spam checker callbacks are: First introduced in Synapse v1.37.0 Called when receiving an event from a client or via federation. The module can return
@@ -200,6 +201,7 @@ callback returns First introduced in Synapse v1.37.0 Called when a user is trying to join a room. The module must return a First introduced in Synapse v1.37.0 Called when processing an invitation. The module must return a First introduced in Synapse v1.45.0Callbacks
+check_event_for_spam
async def check_event_for_spam(event: "synapse.events.EventBase") -> Union[bool, str]
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
async def user_may_join_room(user: str, room: str, is_invited: bool) -> bool
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
async def user_may_invite(inviter: str, invitee: str, room_id: str) -> bool
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
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