From 78d5896d19692e4b6cdbf09f807915e6b0929ce5 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Wed, 20 Oct 2021 13:04:27 +0200 Subject: [PATCH] Document the version of Synapse each module callback was introduced in (#11132) * Mention callbacks introduced in v1.37.0 According to the documentation introduced in https://github.com/matrix-org/synapse/pull/10062 * Mention callbacks introduced in v1.39.0 According to https://github.com/matrix-org/synapse/pull/10386 and https://github.com/matrix-org/synapse/pull/9884 * Mention callbacks introduced in v1.42.0 According to https://github.com/matrix-org/synapse/pull/10524 * Mention callbacks introduced in v1.44.0 and v1.45.0 As per https://github.com/matrix-org/synapse/pull/10898, https://github.com/matrix-org/synapse/pull/10910 and https://github.com/matrix-org/synapse/pull/10894 * Mention callbacks introduced in v1.46.0 According to https://github.com/matrix-org/synapse/pull/10548 --- changelog.d/11132.doc | 1 + docs/modules/account_validity_callbacks.md | 4 ++++ .../password_auth_provider_callbacks.md | 6 +++++ docs/modules/presence_router_callbacks.md | 4 ++++ docs/modules/spam_checker_callbacks.md | 22 +++++++++++++++++++ docs/modules/third_party_rules_callbacks.md | 8 +++++++ 6 files changed, 45 insertions(+) create mode 100644 changelog.d/11132.doc diff --git a/changelog.d/11132.doc b/changelog.d/11132.doc new file mode 100644 index 000000000..4f38be5b2 --- /dev/null +++ b/changelog.d/11132.doc @@ -0,0 +1 @@ +Document the version of Synapse each module callback was introduced in. diff --git a/docs/modules/account_validity_callbacks.md b/docs/modules/account_validity_callbacks.md index 836bda70b..3cd0e7219 100644 --- a/docs/modules/account_validity_callbacks.md +++ b/docs/modules/account_validity_callbacks.md @@ -9,6 +9,8 @@ The available account validity callbacks are: ### `is_user_expired` +_First introduced in Synapse v1.39.0_ + ```python async def is_user_expired(user: str) -> Optional[bool] ``` @@ -29,6 +31,8 @@ any of the subsequent implementations of this callback. ### `on_user_registration` +_First introduced in Synapse v1.39.0_ + ```python async def on_user_registration(user: str) -> None ``` diff --git a/docs/modules/password_auth_provider_callbacks.md b/docs/modules/password_auth_provider_callbacks.md index bb921def8..9dddfdfaa 100644 --- a/docs/modules/password_auth_provider_callbacks.md +++ b/docs/modules/password_auth_provider_callbacks.md @@ -8,6 +8,8 @@ registered by using the Module API's `register_password_auth_provider_callbacks` ### `auth_checkers` +_First introduced in Synapse v1.46.0_ + ``` auth_checkers: Dict[Tuple[str,Tuple], Callable] ``` @@ -55,6 +57,8 @@ authentication fails. ### `check_3pid_auth` +_First introduced in Synapse v1.46.0_ + ```python async def check_3pid_auth( medium: str, @@ -86,6 +90,8 @@ the authentication is denied. ### `on_logged_out` +_First introduced in Synapse v1.46.0_ + ```python async def on_logged_out( user_id: str, diff --git a/docs/modules/presence_router_callbacks.md b/docs/modules/presence_router_callbacks.md index 349e185bd..d3da25cef 100644 --- a/docs/modules/presence_router_callbacks.md +++ b/docs/modules/presence_router_callbacks.md @@ -10,6 +10,8 @@ The available presence router callbacks are: ### `get_users_for_states` +_First introduced in Synapse v1.42.0_ + ```python async def get_users_for_states( state_updates: Iterable["synapse.api.UserPresenceState"], @@ -30,6 +32,8 @@ Synapse concatenates the sets associated with this key from each dictionary. ### `get_interested_users` +_First introduced in Synapse v1.42.0_ + ```python async def get_interested_users( user_id: str diff --git a/docs/modules/spam_checker_callbacks.md b/docs/modules/spam_checker_callbacks.md index 7d954cbe9..534ea196e 100644 --- a/docs/modules/spam_checker_callbacks.md +++ b/docs/modules/spam_checker_callbacks.md @@ -10,6 +10,8 @@ The available spam checker callbacks are: ### `check_event_for_spam` +_First introduced in Synapse v1.37.0_ + ```python async def check_event_for_spam(event: "synapse.events.EventBase") -> Union[bool, str] ``` @@ -26,6 +28,8 @@ any of the subsequent implementations of this callback. ### `user_may_join_room` +_First introduced in Synapse v1.37.0_ + ```python async def user_may_join_room(user: str, room: str, is_invited: bool) -> bool ``` @@ -46,6 +50,8 @@ any of the subsequent implementations of this callback. ### `user_may_invite` +_First introduced in Synapse v1.37.0_ + ```python async def user_may_invite(inviter: str, invitee: str, room_id: str) -> bool ``` @@ -61,6 +67,8 @@ any of the subsequent implementations of this callback. ### `user_may_send_3pid_invite` +_First introduced in Synapse v1.45.0_ + ```python async def user_may_send_3pid_invite( inviter: str, @@ -101,6 +109,8 @@ any of the subsequent implementations of this callback. ### `user_may_create_room` +_First introduced in Synapse v1.37.0_ + ```python async def user_may_create_room(user: str) -> bool ``` @@ -115,6 +125,8 @@ any of the subsequent implementations of this callback. ### `user_may_create_room_with_invites` +_First introduced in Synapse v1.44.0_ + ```python async def user_may_create_room_with_invites( user: str, @@ -149,6 +161,8 @@ any of the subsequent implementations of this callback. ### `user_may_create_room_alias` +_First introduced in Synapse v1.37.0_ + ```python async def user_may_create_room_alias(user: str, room_alias: "synapse.types.RoomAlias") -> bool ``` @@ -164,6 +178,8 @@ any of the subsequent implementations of this callback. ### `user_may_publish_room` +_First introduced in Synapse v1.37.0_ + ```python async def user_may_publish_room(user: str, room_id: str) -> bool ``` @@ -179,6 +195,8 @@ any of the subsequent implementations of this callback. ### `check_username_for_spam` +_First introduced in Synapse v1.37.0_ + ```python async def check_username_for_spam(user_profile: Dict[str, str]) -> bool ``` @@ -201,6 +219,8 @@ any of the subsequent implementations of this callback. ### `check_registration_for_spam` +_First introduced in Synapse v1.37.0_ + ```python async def check_registration_for_spam( email_threepid: Optional[dict], @@ -232,6 +252,8 @@ this callback. ### `check_media_file_for_spam` +_First introduced in Synapse v1.37.0_ + ```python async def check_media_file_for_spam( file_wrapper: "synapse.rest.media.v1.media_storage.ReadableFileWrapper", diff --git a/docs/modules/third_party_rules_callbacks.md b/docs/modules/third_party_rules_callbacks.md index 5371e7f80..034923da0 100644 --- a/docs/modules/third_party_rules_callbacks.md +++ b/docs/modules/third_party_rules_callbacks.md @@ -10,6 +10,8 @@ The available third party rules callbacks are: ### `check_event_allowed` +_First introduced in Synapse v1.39.0_ + ```python async def check_event_allowed( event: "synapse.events.EventBase", @@ -51,6 +53,8 @@ any of the subsequent implementations of this callback. ### `on_create_room` +_First introduced in Synapse v1.39.0_ + ```python async def on_create_room( requester: "synapse.types.Requester", @@ -76,6 +80,8 @@ callback. ### `check_threepid_can_be_invited` +_First introduced in Synapse v1.39.0_ + ```python async def check_threepid_can_be_invited( medium: str, @@ -94,6 +100,8 @@ any of the subsequent implementations of this callback. ### `check_visibility_can_be_modified` +_First introduced in Synapse v1.39.0_ + ```python async def check_visibility_can_be_modified( room_id: str,