From 7c5dd6ffb85f208632f7a2018a922b5ef2083c18 Mon Sep 17 00:00:00 2001 From: anoadragon453 Date: Tue, 22 Mar 2022 16:30:53 +0000 Subject: deploy: 6b26536a52f77aa5573b4d2afedae448fac31b7c --- latest/modules/third_party_rules_callbacks.html | 31 ++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'latest/modules/third_party_rules_callbacks.html') diff --git a/latest/modules/third_party_rules_callbacks.html b/latest/modules/third_party_rules_callbacks.html index dc966fbdb8..54ce7ea041 100644 --- a/latest/modules/third_party_rules_callbacks.html +++ b/latest/modules/third_party_rules_callbacks.html @@ -99,7 +99,7 @@ @@ -290,6 +290,35 @@ it will be included in this state.

into the room, which means this callback cannot be used to deny persisting the event. To deny an incoming event, see check_event_for_spam instead.

If multiple modules implement this callback, Synapse runs them all in order.

+

check_can_shutdown_room

+

First introduced in Synapse v1.55.0

+
async def check_can_shutdown_room(
+    user_id: str, room_id: str,
+) -> bool:
+
+

Called when an admin user requests the shutdown of a room. The module must return a +boolean indicating whether the shutdown can go through. If the callback returns False, +the shutdown will not proceed and the caller will see a M_FORBIDDEN error.

+

If multiple modules implement this callback, they will be considered in order. If a +callback returns True, Synapse falls through to the next one. The value of the first +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_can_deactivate_user

+

First introduced in Synapse v1.55.0

+
async def check_can_deactivate_user(
+    user_id: str, by_admin: bool,
+) -> bool:
+
+

Called when the deactivation of a user is requested. User deactivation can be +performed by an admin or the user themselves, so developers are encouraged to check the +requester when implementing this callback. The module must return a +boolean indicating whether the deactivation can go through. If the callback returns False, +the deactivation will not proceed and the caller will see a M_FORBIDDEN error.

+

The module is passed two parameters, user_id which is the ID of the user being deactivated, and by_admin which is True if the request is made by a serve admin, and False otherwise.

+

If multiple modules implement this callback, they will be considered in order. If a +callback returns True, Synapse falls through to the next one. The value of the first +callback that does not return True will be used. If this happens, Synapse will not call +any of the subsequent implementations of this callback.

on_profile_update

First introduced in Synapse v1.54.0

async def on_profile_update(
-- 
cgit 1.5.1