From 9cd8fecdc5cb2bb4064410ebc8e125551a617820 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Wed, 8 Mar 2023 15:42:24 +0000 Subject: 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. --- tests/rest/client/test_account.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/rest/client/test_account.py b/tests/rest/client/test_account.py index 2b05dffc7d..7f675c44a2 100644 --- a/tests/rest/client/test_account.py +++ b/tests/rest/client/test_account.py @@ -1249,9 +1249,8 @@ class AccountStatusTestCase(unittest.HomeserverTestCase): # account status will fail. return UserID.from_string(user_id).localpart == "someuser" - self.hs.get_account_validity_handler()._is_user_expired_callbacks.append( - is_expired - ) + account_validity_callbacks = self.hs.get_module_api_callbacks().account_validity + account_validity_callbacks.is_user_expired_callbacks.append(is_expired) self._test_status( users=[user], -- cgit 1.5.1