From e590ebcbaccff5892f5bb15f81f5036ca6e93a71 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Wed, 20 Nov 2024 14:38:42 -0700 Subject: [PATCH] connector/client: add more logging to IsLoggedIn Signed-off-by: Sumner Evans --- pkg/connector/client.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/connector/client.go b/pkg/connector/client.go index 8ecb4106..03ebdd83 100644 --- a/pkg/connector/client.go +++ b/pkg/connector/client.go @@ -628,7 +628,14 @@ func (t *TelegramClient) getUserInfoFromTelegramUser(ctx context.Context, u tg.U } func (t *TelegramClient) IsLoggedIn() bool { - return t != nil && t.client != nil && t.userLogin.Metadata.(*UserLoginMetadata).Session.HasAuthKey() + if t == nil { + return false + } + t.main.Bridge.Log.Debug(). + Bool("has_client", t.client != nil). + Bool("has_auth_key", t.userLogin.Metadata.(*UserLoginMetadata).Session.HasAuthKey()). + Msg("Checking if user is logged in") + return t.client != nil && t.userLogin.Metadata.(*UserLoginMetadata).Session.HasAuthKey() } func (t *TelegramClient) LogoutRemote(ctx context.Context) {