summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul Evans <leonerd@leonerd.org.uk>2017-01-25 18:15:19 +0000
committerGitHub <noreply@github.com>2017-01-25 18:15:19 +0000
commite978247fe560eafb8462d5f8e699ad6ff86b93c1 (patch)
tree7f64c1b2dda16d751a28223a7f3cc0f73910a795
parentMerge branch 'erikj/current_state_fix' into develop (diff)
parentDon't clobber a displayname or avatar_url if provided by an m.room.member event (diff)
downloadsynapse-e978247fe560eafb8462d5f8e699ad6ff86b93c1.tar.xz
Merge pull request #1852 from matrix-org/paul/issue-1382
Don't clobber a displayname or avatar_url if provided by an m.room.member event
-rw-r--r--synapse/handlers/message.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index 88bd2d572e..7a498af5a2 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -208,8 +208,10 @@ class MessageHandler(BaseHandler):
                     content = builder.content
 
                     try:
-                        content["displayname"] = yield profile.get_displayname(target)
-                        content["avatar_url"] = yield profile.get_avatar_url(target)
+                        if "displayname" not in content:
+                            content["displayname"] = yield profile.get_displayname(target)
+                        if "avatar_url" not in content:
+                            content["avatar_url"] = yield profile.get_avatar_url(target)
                     except Exception as e:
                         logger.info(
                             "Failed to get profile information for %r: %s",