summary refs log tree commit diff
path: root/synapse/module_api/callbacks/__init__.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2023-03-08 15:42:24 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2023-03-09 16:50:31 +0000
commit9cd8fecdc5cb2bb4064410ebc8e125551a617820 (patch)
treeb669aeb1b2c15e1288fb7f466e5dccc719e01d9c /synapse/module_api/callbacks/__init__.py
parentAdd a missing endpoint to the workers documentation. (#15223) (diff)
downloadsynapse-9cd8fecdc5cb2bb4064410ebc8e125551a617820.tar.xz
Move Account Validity callbacks to a dedicated file
Spreading module callback registration across the codebase is both a bit
messy and makes it unclear where a user should register callbacks if
they want to define a new class of callbacks.

Consolidating these under the synapse.module_api module cleans things up
a bit, puts related code in the same place and makes it much more
obvious how to extend it.
Diffstat (limited to 'synapse/module_api/callbacks/__init__.py')
-rw-r--r--synapse/module_api/callbacks/__init__.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/synapse/module_api/callbacks/__init__.py b/synapse/module_api/callbacks/__init__.py
new file mode 100644

index 0000000000..884c6413cc --- /dev/null +++ b/synapse/module_api/callbacks/__init__.py
@@ -0,0 +1,24 @@ +# Copyright 2023 The Matrix.org Foundation C.I.C. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from .account_validity_callbacks import AccountValidityModuleApiCallbacks + +__all__ = [ + "ModuleApiCallbacks", +] + + +class ModuleApiCallbacks: + def __init__(self) -> None: + self.account_validity = AccountValidityModuleApiCallbacks()