diff options
author | Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> | 2023-05-05 15:51:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-05 15:51:46 +0100 |
commit | 7c95b65873c7a858388b9c99c7e9e15dc5ccb2b5 (patch) | |
tree | f50dd2288c2561afbfeed965e02563a9711e5ce9 /synapse/storage | |
parent | Factor out an `is_mine_server_name` method (#15542) (diff) | |
download | synapse-7c95b65873c7a858388b9c99c7e9e15dc5ccb2b5.tar.xz |
Clean up and clarify "Create or modify Account" Admin API documentation (#15544)
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/databases/main/profile.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/synapse/storage/databases/main/profile.py b/synapse/storage/databases/main/profile.py index b109f8c07f..c4022d2427 100644 --- a/synapse/storage/databases/main/profile.py +++ b/synapse/storage/databases/main/profile.py @@ -85,6 +85,14 @@ class ProfileWorkerStore(SQLBaseStore): async def set_profile_displayname( self, user_id: UserID, new_displayname: Optional[str] ) -> None: + """ + Set the display name of a user. + + Args: + user_id: The user's ID. + 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", @@ -99,6 +107,14 @@ class ProfileWorkerStore(SQLBaseStore): async def set_profile_avatar_url( self, user_id: UserID, new_avatar_url: Optional[str] ) -> None: + """ + Set the avatar of a user. + + Args: + user_id: The user's ID. + 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", |