From c0c21a35a4cfd326423ad530926a0e96c1b07dcf Mon Sep 17 00:00:00 2001 From: bodqhrohro Date: Wed, 20 Nov 2019 23:45:30 +0200 Subject: Handle unsubscribe presence too, improve logging --- telegram/connect.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'telegram') diff --git a/telegram/connect.go b/telegram/connect.go index 400c706..c30f9a0 100644 --- a/telegram/connect.go +++ b/telegram/connect.go @@ -3,6 +3,7 @@ package telegram import ( "github.com/pkg/errors" + log "github.com/sirupsen/logrus" "github.com/zelenin/go-tdlib/client" ) @@ -12,6 +13,8 @@ func (c *Client) Connect() error { return nil } + log.Warn("Connecting to Telegram network...") + authorizer := client.ClientAuthorizer() go func() { for { @@ -48,6 +51,10 @@ func (c *Client) Disconnect() { return } + log.Warn("Disconnecting from Telegram network...") + + // TODO: send unavailable presence to cached chats + c.client.Stop() c.online = false } -- cgit v1.2.3