From d5541caf8d4921b990a0ca23f6a2ee34046f71ab Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 31 Aug 2019 11:53:30 +0300 Subject: [PATCH] Support disabling setting displayname/avatar url --- maubot/client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/maubot/client.py b/maubot/client.py index 2a20db2..3662dae 100644 --- a/maubot/client.py +++ b/maubot/client.py @@ -200,13 +200,15 @@ class Client: if displayname is None or displayname == self.displayname: return 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: if avatar_url is None or avatar_url == self.avatar_url: return 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: if not access_token and not homeserver: