From 89657801eef1575f1ce5105827d40278d619870a Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 19 May 2022 22:38:22 -0600 Subject: [PATCH] Hardcode the user directory to be disabled --- synapse/handlers/user_directory.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/synapse/handlers/user_directory.py b/synapse/handlers/user_directory.py index a343637b82ad..bc1c5a94f186 100644 --- a/synapse/handlers/user_directory.py +++ b/synapse/handlers/user_directory.py @@ -122,7 +122,8 @@ def __init__(self, hs: "HomeServer"): # Set of server names. self._is_refreshing_remote_profiles_for_servers: Set[str] = set() - if self.update_user_directory: + # T2B: Disable user directory + if self.update_user_directory and False: self.notifier.add_replication_callback(self.notify_new_event) # We kick this off so that we don't have to wait for a change before @@ -170,6 +171,11 @@ async def search_users( def notify_new_event(self) -> None: """Called when there may be more deltas to process""" + + # T2B: Disable user directory + if True: + return + if not self.update_user_directory: return @@ -194,6 +200,10 @@ async def handle_local_profile_change( # FIXME(https://github.com/matrix-org/synapse/issues/3714): We should # probably do this in the same worker as all the other changes. + # T2B: Disable user directory + if True: + return + if await self.store.should_include_local_user_in_dir(user_id): await self.store.update_profile_in_user_dir( user_id, profile.display_name, profile.avatar_url @@ -203,6 +213,11 @@ async def handle_local_user_deactivated(self, user_id: str) -> None: """Called when a user ID is deactivated""" # FIXME(https://github.com/matrix-org/synapse/issues/3714): We should # probably do this in the same worker as all the other changes. + + # T2B: Disable user directory + if True: + return + await self.store.remove_from_user_dir(user_id) async def _unsafe_process(self) -> None: