summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorDirk Klimpel <5740567+dklimpel@users.noreply.github.com>2020-12-17 13:05:39 +0100
committerGitHub <noreply@github.com>2020-12-17 12:05:39 +0000
commitc07022303ef596fe7f42f6eb7001660a62801715 (patch)
treef4d6ffdfbc30b04e52990ce3c005eaab7ce9fd9c /synapse
parentMake search statement in List Room and User Admin API case-insensitive (#8931) (diff)
downloadsynapse-c07022303ef596fe7f42f6eb7001660a62801715.tar.xz
Fix a bug that deactivated users appear in the directory (#8933)
Fixes a bug that deactivated users appear in the directory when their profile information was updated.

To change profile information of deactivated users is neccesary for example you will remove displayname or avatar.
But they should not appear in directory. They are deactivated.



Co-authored-by: Erik Johnston <erikj@jki.re>
Diffstat (limited to 'synapse')
-rw-r--r--synapse/handlers/user_directory.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/handlers/user_directory.py b/synapse/handlers/user_directory.py
index 3d80371f06..7c4eeaaa5e 100644
--- a/synapse/handlers/user_directory.py
+++ b/synapse/handlers/user_directory.py
@@ -113,9 +113,13 @@ class UserDirectoryHandler(StateDeltasHandler):
         """
         # FIXME(#3714): We should probably do this in the same worker as all
         # the other changes.
-        is_support = await self.store.is_support_user(user_id)
+
         # Support users are for diagnostics and should not appear in the user directory.
-        if not is_support:
+        is_support = await self.store.is_support_user(user_id)
+        # When change profile information of deactivated user it should not appear in the user directory.
+        is_deactivated = await self.store.get_user_deactivated_status(user_id)
+
+        if not (is_support or is_deactivated):
             await self.store.update_profile_in_user_dir(
                 user_id, profile.display_name, profile.avatar_url
             )