switch to setting default displayname in the storage layer

to avoid clobbering guest user displaynames on registration
This commit is contained in:
Matthew Hodgson 2017-11-01 15:51:25 +00:00
parent f8420d6279
commit 9f7a555b4e
2 changed files with 5 additions and 10 deletions

View file

@ -177,9 +177,11 @@ class RegistrationStore(background_updates.BackgroundUpdateStore):
)
if create_profile_with_localpart:
# set a default displayname serverside to avoid ugly race
# between auto-joins and clients trying to set displaynames
txn.execute(
"INSERT INTO profiles(user_id) VALUES (?)",
(create_profile_with_localpart,)
"INSERT INTO profiles(user_id, displayname) VALUES (?,?)",
(create_profile_with_localpart, create_profile_with_localpart)
)
self._invalidate_cache_and_stream(