From d02150fd84e0258e96f3d64d4074796a459b11df Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Fri, 5 Jun 2026 15:19:47 +0300 Subject: [PATCH] Remove code that accidentally came here from https://github.com/element-hq/synapse/pull/19542/changes#r2913827732 and was then removed in https://github.com/element-hq/synapse/pull/19398 --- synapse/handlers/profile.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py index aede225685..0b185f8fef 100644 --- a/synapse/handlers/profile.py +++ b/synapse/handlers/profile.py @@ -465,27 +465,6 @@ class ProfileHandler: profile_updates: list[tuple[str, JsonValue | None]] = [] current_profile: ProfileInfo | None = None - if not by_admin: - current_profile = await self.store.get_profileinfo(target_user) - if not self.hs.config.registration.enable_set_displayname: - if current_profile.display_name: - # SUSPICIOUS: It seems strange to block deactivation on this, - # though this is preserving previous behaviour. - raise SynapseError( - 400, - "Changing display name is disabled on this server", - Codes.FORBIDDEN, - ) - - if not self.hs.config.registration.enable_set_avatar_url: - if current_profile.avatar_url: - # SUSPICIOUS: It seems strange to block deactivation on this, - # though this is preserving previous behaviour. - raise SynapseError( - 400, - "Changing avatar is disabled on this server", - Codes.FORBIDDEN, - ) if self._msc4429_enabled: if current_profile is None: