summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-05-14 14:19:10 +0100
committerDavid Baker <dave@matrix.org>2015-05-14 14:19:59 +0100
commit67800f7626d07202b19da9090432aab4b0bc1aef (patch)
tree307214f85562542bd1e8fb297628fef1419f4bd7
parentMerge pull request #150 from matrix-org/notifier_unify (diff)
downloadsynapse-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.py3
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
         )