Avoid broken state on a failed logout attempt

master
Bohdan Horbeshko 2 months ago
parent f56e6ac187
commit 67c38823f2

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

Loading…
Cancel
Save