mirror of
https://github.com/maubot/maubot.git
synced 2024-10-01 01:06:10 -04:00
Support disabling setting displayname/avatar url
This commit is contained in:
parent
cbe312176d
commit
d5541caf8d
@ -200,13 +200,15 @@ class Client:
|
|||||||
if displayname is None or displayname == self.displayname:
|
if displayname is None or displayname == self.displayname:
|
||||||
return
|
return
|
||||||
self.db_instance.displayname = displayname
|
self.db_instance.displayname = displayname
|
||||||
await self.client.set_displayname(self.displayname)
|
if self.displayname != "disable":
|
||||||
|
await self.client.set_displayname(self.displayname)
|
||||||
|
|
||||||
async def update_avatar_url(self, avatar_url: ContentURI) -> None:
|
async def update_avatar_url(self, avatar_url: ContentURI) -> None:
|
||||||
if avatar_url is None or avatar_url == self.avatar_url:
|
if avatar_url is None or avatar_url == self.avatar_url:
|
||||||
return
|
return
|
||||||
self.db_instance.avatar_url = avatar_url
|
self.db_instance.avatar_url = avatar_url
|
||||||
await self.client.set_avatar_url(self.avatar_url)
|
if self.avatar_url != "disable":
|
||||||
|
await self.client.set_avatar_url(self.avatar_url)
|
||||||
|
|
||||||
async def update_access_details(self, access_token: str, homeserver: str) -> None:
|
async def update_access_details(self, access_token: str, homeserver: str) -> None:
|
||||||
if not access_token and not homeserver:
|
if not access_token and not homeserver:
|
||||||
|
Loading…
Reference in New Issue
Block a user