diff --git a/telegram/commands.go b/telegram/commands.go index 9251ebb..d9dc1f2 100644 --- a/telegram/commands.go +++ b/telegram/commands.go @@ -279,16 +279,15 @@ func (c *Client) ProcessTransportCommand(cmdline string, resource string) string return notOnline } - for _, id := range c.cache.ChatsKeys() { - c.unsubscribe(id) - } - _, err := c.client.LogOut() if err != nil { - c.forceClose() return errors.Wrap(err, "Logout error").Error() } + for _, id := range c.cache.ChatsKeys() { + c.unsubscribe(id) + } + c.Session.Login = "" // cancel auth case "cancelauth":