client: use both reconnection detection methods

Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
This commit is contained in:
Sumner Evans
2024-09-10 08:30:33 -06:00
parent 87f9f008e6
commit 4692d46305
3 changed files with 6 additions and 5 deletions
+3 -2
View File
@@ -195,7 +195,8 @@ func NewTelegramClient(ctx context.Context, tc *TelegramConnector, login *bridge
Logger: zaplog,
UpdateHandler: client.updatesManager,
OnDead: client.onDead,
OnConnected: client.onConnected,
OnSession: client.onConnectionStateChange,
OnConnected: client.onConnectionStateChange,
OnAuthError: client.onAuthError,
PingTimeout: time.Duration(tc.Config.Ping.TimeoutSeconds) * time.Second,
PingInterval: time.Duration(tc.Config.Ping.IntervalSeconds) * time.Second,
@@ -349,7 +350,7 @@ func (t *TelegramClient) onDead() {
})
}
func (t *TelegramClient) onConnected() {
func (t *TelegramClient) onConnectionStateChange() {
authStatus, err := t.client.Auth().Status(context.Background())
if err != nil {
t.userLogin.BridgeState.Send(status.BridgeState{