From 720210ac08f637b2fa455f205ff4c6292fed7260 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 15 Nov 2018 11:45:36 +0200 Subject: [PATCH] Check if client is connected before checking if authorized. Fixes #215 --- mautrix_telegram/abstract_user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mautrix_telegram/abstract_user.py b/mautrix_telegram/abstract_user.py index 5075fd67..aadaf5dc 100644 --- a/mautrix_telegram/abstract_user.py +++ b/mautrix_telegram/abstract_user.py @@ -149,7 +149,7 @@ class AbstractUser(ABC): raise NotImplementedError() async def is_logged_in(self) -> bool: - return self.client and await self.client.is_user_authorized() + return self.client and self.client.is_connected() and await self.client.is_user_authorized() async def has_full_access(self, allow_bot: bool = False) -> bool: return (self.puppet_whitelisted