From 1b2024e456a1ef3af9da87e9b8d836c937254831 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 18 Aug 2020 20:27:10 +0300 Subject: [PATCH] Update username even if disable_updates is true --- mautrix_telegram/puppet.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/mautrix_telegram/puppet.py b/mautrix_telegram/puppet.py index e7c38789..cc6e5cf0 100644 --- a/mautrix_telegram/puppet.py +++ b/mautrix_telegram/puppet.py @@ -233,18 +233,17 @@ class Puppet(BasePuppet): source.log.exception(f"Failed to update info of {self.tgid}") async def update_info(self, source: 'AbstractUser', info: User) -> None: - if self.disable_updates: - return changed = False if self.username != info.username: self.username = info.username changed = True - try: - changed = await self.update_displayname(source, info) or changed - changed = await self.update_avatar(source, info.photo) or changed - except Exception: - self.log.exception(f"Failed to update info from source {source.tgid}") + if not self.disable_updates: + try: + changed = await self.update_displayname(source, info) or changed + changed = await self.update_avatar(source, info.photo) or changed + except Exception: + self.log.exception(f"Failed to update info from source {source.tgid}") self.is_bot = info.bot