client: use ping callback to determine if connection is still alive

Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
This commit is contained in:
Sumner Evans
2024-09-16 14:20:36 -06:00
parent ff48398430
commit 7a02d6a35b
3 changed files with 10 additions and 9 deletions
+1
View File
@@ -198,6 +198,7 @@ func NewTelegramClient(ctx context.Context, tc *TelegramConnector, login *bridge
OnDead: client.onDead,
OnSession: client.onConnectionStateChange,
OnConnected: client.onConnectionStateChange,
PingCallback: client.onConnectionStateChange,
OnAuthError: client.onAuthError,
PingTimeout: time.Duration(tc.Config.Ping.TimeoutSeconds) * time.Second,
PingInterval: time.Duration(tc.Config.Ping.IntervalSeconds) * time.Second,