Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Require that modules register their callbacks using keyword arguments #11975

Merged
merged 1 commit into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/11975.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Require that modules register their callbacks using keyword arguments.
6 changes: 6 additions & 0 deletions synapse/module_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ def __init__(self, hs: "HomeServer", auth_handler: AuthHandler) -> None:

def register_spam_checker_callbacks(
self,
*,
check_event_for_spam: Optional[CHECK_EVENT_FOR_SPAM_CALLBACK] = None,
user_may_join_room: Optional[USER_MAY_JOIN_ROOM_CALLBACK] = None,
user_may_invite: Optional[USER_MAY_INVITE_CALLBACK] = None,
Expand Down Expand Up @@ -245,6 +246,7 @@ def register_spam_checker_callbacks(

def register_account_validity_callbacks(
self,
*,
is_user_expired: Optional[IS_USER_EXPIRED_CALLBACK] = None,
on_user_registration: Optional[ON_USER_REGISTRATION_CALLBACK] = None,
on_legacy_send_mail: Optional[ON_LEGACY_SEND_MAIL_CALLBACK] = None,
Expand All @@ -265,6 +267,7 @@ def register_account_validity_callbacks(

def register_third_party_rules_callbacks(
self,
*,
check_event_allowed: Optional[CHECK_EVENT_ALLOWED_CALLBACK] = None,
on_create_room: Optional[ON_CREATE_ROOM_CALLBACK] = None,
check_threepid_can_be_invited: Optional[
Expand All @@ -289,6 +292,7 @@ def register_third_party_rules_callbacks(

def register_presence_router_callbacks(
self,
*,
get_users_for_states: Optional[GET_USERS_FOR_STATES_CALLBACK] = None,
get_interested_users: Optional[GET_INTERESTED_USERS_CALLBACK] = None,
) -> None:
Expand All @@ -303,6 +307,7 @@ def register_presence_router_callbacks(

def register_password_auth_provider_callbacks(
self,
*,
check_3pid_auth: Optional[CHECK_3PID_AUTH_CALLBACK] = None,
on_logged_out: Optional[ON_LOGGED_OUT_CALLBACK] = None,
auth_checkers: Optional[
Expand All @@ -327,6 +332,7 @@ def register_password_auth_provider_callbacks(

def register_background_update_controller_callbacks(
self,
*,
on_update: ON_UPDATE_CALLBACK,
default_batch_size: Optional[DEFAULT_BATCH_SIZE_CALLBACK] = None,
min_batch_size: Optional[MIN_BATCH_SIZE_CALLBACK] = None,
Expand Down