Skip to content

Commit

Permalink
connector/client: add more logging to IsLoggedIn
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <[email protected]>
  • Loading branch information
sumnerevans committed Nov 20, 2024
1 parent f7ea8f4 commit e590ebc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/connector/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e590ebc

Please sign in to comment.