From 1077d50c655303194698f01bd84668a3ab4ef865 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Thu, 31 Dec 2020 16:20:32 +0000 Subject: Merged commit 'deff8f628' into anoa/dinsic_release_1_23_1 --- synapse/handlers/profile.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'synapse/handlers/profile.py') diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py index 9fe7e7708a..40b1c25a36 100644 --- a/synapse/handlers/profile.py +++ b/synapse/handlers/profile.py @@ -300,6 +300,14 @@ class ProfileHandler(BaseHandler): if new_displayname == "": displayname_to_set = None + # If the admin changes the display name of a user, the requesting user cannot send + # the join event to update the displayname in the rooms. + # This must be done by the target user himself. + if by_admin: + requester = create_requester( + target_user, authenticated_entity=requester.authenticated_entity, + ) + if len(self.hs.config.replicate_user_profiles_to) > 0: cur_batchnum = ( await self.store.get_latest_profile_replication_batch_number() @@ -456,7 +464,9 @@ class ProfileHandler(BaseHandler): # Same like set_displayname if by_admin: - requester = create_requester(target_user) + requester = create_requester( + target_user, authenticated_entity=requester.authenticated_entity + ) if len(self.hs.config.replicate_user_profiles_to) > 0: cur_batchnum = ( -- cgit 1.5.1