diff options
author | David Baker <dave@matrix.org> | 2015-05-14 14:19:10 +0100 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2015-05-14 14:19:59 +0100 |
commit | 67800f7626d07202b19da9090432aab4b0bc1aef (patch) | |
tree | 307214f85562542bd1e8fb297628fef1419f4bd7 | |
parent | Merge pull request #150 from matrix-org/notifier_unify (diff) | |
download | synapse-67800f7626d07202b19da9090432aab4b0bc1aef.tar.xz |
Treat setting your display name to the empty string as removing it (SYN-186).
Diffstat (limited to '')
-rw-r--r-- | synapse/handlers/profile.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py index 71ff78ab23..799faffe53 100644 --- a/synapse/handlers/profile.py +++ b/synapse/handlers/profile.py @@ -88,6 +88,9 @@ class ProfileHandler(BaseHandler): if target_user != auth_user: raise AuthError(400, "Cannot set another user's displayname") + if new_displayname == '': + new_displayname = None + yield self.store.set_profile_displayname( target_user.localpart, new_displayname ) |