mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 07:15:32 -04:00
Remove user's avatar URL and displayname when deactivated. (#8932)
This only applies if the user's data is to be erased.
This commit is contained in:
parent
789d9ebad3
commit
7a2e9b549d
13 changed files with 351 additions and 17 deletions
|
@ -286,13 +286,19 @@ class ProfileHandler(BaseHandler):
|
|||
400, "Avatar URL is too long (max %i)" % (MAX_AVATAR_URL_LEN,)
|
||||
)
|
||||
|
||||
avatar_url_to_set = new_avatar_url # type: Optional[str]
|
||||
if new_avatar_url == "":
|
||||
avatar_url_to_set = None
|
||||
|
||||
# Same like set_displayname
|
||||
if by_admin:
|
||||
requester = create_requester(
|
||||
target_user, authenticated_entity=requester.authenticated_entity
|
||||
)
|
||||
|
||||
await self.store.set_profile_avatar_url(target_user.localpart, new_avatar_url)
|
||||
await self.store.set_profile_avatar_url(
|
||||
target_user.localpart, avatar_url_to_set
|
||||
)
|
||||
|
||||
if self.hs.config.user_directory_search_all_users:
|
||||
profile = await self.store.get_profileinfo(target_user.localpart)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue