summary refs log tree commit diff
path: root/synapse/handlers/user_directory.py
diff options
context:
space:
mode:
authorAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2023-04-17 18:57:40 -0600
committerGitHub <noreply@github.com>2023-04-18 00:57:40 +0000
commitaec639e3e33f5ca2f3456c715d28fd7a63c63c8a (patch)
treec5c765186899cd4527e2e57d9c084c8c0691d0fc /synapse/handlers/user_directory.py
parentAdd a note to the config documentation that the 'delete_stale_devices_after' ... (diff)
downloadsynapse-aec639e3e33f5ca2f3456c715d28fd7a63c63c8a.tar.xz
Move Spam Checker callbacks to a dedicated file (#15453)
Diffstat (limited to 'synapse/handlers/user_directory.py')
-rw-r--r--synapse/handlers/user_directory.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/handlers/user_directory.py b/synapse/handlers/user_directory.py
index 28a92d41d6..05197edc95 100644
--- a/synapse/handlers/user_directory.py
+++ b/synapse/handlers/user_directory.py
@@ -94,7 +94,7 @@ class UserDirectoryHandler(StateDeltasHandler):
         self.is_mine_id = hs.is_mine_id
         self.update_user_directory = hs.config.worker.should_update_user_directory
         self.search_all_users = hs.config.userdirectory.user_directory_search_all_users
-        self.spam_checker = hs.get_spam_checker()
+        self._spam_checker_module_callbacks = hs.get_module_api_callbacks().spam_checker
         self._hs = hs
 
         # The current position in the current_state_delta stream
@@ -149,7 +149,9 @@ class UserDirectoryHandler(StateDeltasHandler):
         # Remove any spammy users from the results.
         non_spammy_users = []
         for user in results["results"]:
-            if not await self.spam_checker.check_username_for_spam(user):
+            if not await self._spam_checker_module_callbacks.check_username_for_spam(
+                user
+            ):
                 non_spammy_users.append(user)
         results["results"] = non_spammy_users