logout when session expired

This commit is contained in:
zhaoYangguang 2021-06-25 19:13:27 +08:00
parent 8104db9562
commit 98e3f1669c
2 changed files with 3 additions and 1 deletions

View File

@ -277,9 +277,10 @@ func (handler *CommandHandler) CommandLogout(ce *CommandEvent) {
Chats: make(map[string]skype.Conversation),
}
ce.Reply("Logged out successfully.")
leavePortals(ce)
if ce.User.Conn.Refresh != nil {
ce.User.Conn.Refresh <- -1
} else {
leavePortals(ce)
}
}

View File

@ -396,6 +396,7 @@ func (user *User) monitorSession(ce *CommandEvent) {
} else {
ce.Reply("Session expired")
close(user.Conn.Refresh)
leavePortals(ce)
}
}