diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2017-01-24 18:06:07 +0000 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2017-01-24 18:06:07 +0000 |
commit | 10e48d83107492ebf872f8cd8051b95c35adc9f3 (patch) | |
tree | 7f64c1b2dda16d751a28223a7f3cc0f73910a795 /synapse/handlers/message.py | |
parent | Merge branch 'erikj/current_state_fix' into develop (diff) | |
download | synapse-10e48d83107492ebf872f8cd8051b95c35adc9f3.tar.xz |
Don't clobber a displayname or avatar_url if provided by an m.room.member event
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r-- | synapse/handlers/message.py | 6 |
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", |