Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
7b0e2d96
Unverified
Commit
7b0e2d96
authored
5 years ago
by
Dirk Klimpel
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Change displayname of user as admin in rooms (#6876)
parent
fcf45994
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog.d/6572.bugfix
+1
-0
1 addition, 0 deletions
changelog.d/6572.bugfix
synapse/handlers/profile.py
+11
-1
11 additions, 1 deletion
synapse/handlers/profile.py
with
12 additions
and
1 deletion
changelog.d/6572.bugfix
0 → 100644
+
1
−
0
View file @
7b0e2d96
When a user's profile is updated via the admin API, also generate a displayname/avatar update for that user in each room.
This diff is collapsed.
Click to expand it.
synapse/handlers/profile.py
+
11
−
1
View file @
7b0e2d96
...
...
@@ -28,7 +28,7 @@ from synapse.api.errors import (
SynapseError
,
)
from
synapse.metrics.background_process_metrics
import
run_as_background_process
from
synapse.types
import
UserID
,
get_domain_from_id
from
synapse.types
import
UserID
,
create_requester
,
get_domain_from_id
from
._base
import
BaseHandler
...
...
@@ -165,6 +165,12 @@ class BaseProfileHandler(BaseHandler):
if
new_displayname
==
""
:
new_displayname
=
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
)
yield
self
.
store
.
set_profile_displayname
(
target_user
.
localpart
,
new_displayname
)
if
self
.
hs
.
config
.
user_directory_search_all_users
:
...
...
@@ -217,6 +223,10 @@ class BaseProfileHandler(BaseHandler):
400
,
"
Avatar URL is too long (max %i)
"
%
(
MAX_AVATAR_URL_LEN
,)
)
# Same like set_displayname
if
by_admin
:
requester
=
create_requester
(
target_user
)
yield
self
.
store
.
set_profile_avatar_url
(
target_user
.
localpart
,
new_avatar_url
)
if
self
.
hs
.
config
.
user_directory_search_all_users
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment