mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 14:24:56 -04:00
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>
This commit is contained in:
parent
06006058d7
commit
c07022303e
4 changed files with 95 additions and 4 deletions
|
@ -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
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue