diff options
author | Patrick Cloke <patrickc@matrix.org> | 2023-07-26 12:45:17 -0400 |
---|---|---|
committer | Patrick Cloke <patrickc@matrix.org> | 2023-07-26 12:45:17 -0400 |
commit | 02867aeb257c666f23574864b18cf50c4ce99002 (patch) | |
tree | 358aef29f3ec3730457f73fc32a15acf418d1e1e /synapse/storage/databases/main/profile.py | |
parent | FIx-up content hash checking for PDUs vs. delegated PDUs. (diff) | |
parent | Merge branch 'release-v1.89' into develop (diff) | |
download | synapse-02867aeb257c666f23574864b18cf50c4ce99002.tar.xz |
Merge remote-tracking branch 'origin/develop' into clokep/lm
Diffstat (limited to 'synapse/storage/databases/main/profile.py')
-rw-r--r-- | synapse/storage/databases/main/profile.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/synapse/storage/databases/main/profile.py b/synapse/storage/databases/main/profile.py index 660a5507b7..3ba9cc8853 100644 --- a/synapse/storage/databases/main/profile.py +++ b/synapse/storage/databases/main/profile.py @@ -173,9 +173,10 @@ class ProfileWorkerStore(SQLBaseStore): ) async def create_profile(self, user_id: UserID) -> None: + user_localpart = user_id.localpart await self.db_pool.simple_insert( table="profiles", - values={"full_user_id": user_id.to_string()}, + values={"user_id": user_localpart, "full_user_id": user_id.to_string()}, desc="create_profile", ) @@ -190,11 +191,13 @@ class ProfileWorkerStore(SQLBaseStore): new_displayname: The new display name. If this is None, the user's display name is removed. """ + user_localpart = user_id.localpart await self.db_pool.simple_upsert( table="profiles", - keyvalues={"full_user_id": user_id.to_string()}, + keyvalues={"user_id": user_localpart}, values={ "displayname": new_displayname, + "full_user_id": user_id.to_string(), }, desc="set_profile_displayname", ) @@ -210,10 +213,11 @@ class ProfileWorkerStore(SQLBaseStore): new_avatar_url: The new avatar URL. If this is None, the user's avatar is removed. """ + user_localpart = user_id.localpart await self.db_pool.simple_upsert( table="profiles", - keyvalues={"full_user_id": user_id.to_string()}, - values={"avatar_url": new_avatar_url}, + keyvalues={"user_id": user_localpart}, + values={"avatar_url": new_avatar_url, "full_user_id": user_id.to_string()}, desc="set_profile_avatar_url", ) |