From 98e3f1669c43a0ed83458b082643270b1228a048 Mon Sep 17 00:00:00 2001 From: zhaoYangguang <1163765691@qq.com> Date: Fri, 25 Jun 2021 19:13:27 +0800 Subject: [PATCH] logout when session expired --- commands.go | 3 ++- user.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/commands.go b/commands.go index 394fbcb..b3861d9 100644 --- a/commands.go +++ b/commands.go @@ -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) } } diff --git a/user.go b/user.go index e022807..40a2118 100644 --- a/user.go +++ b/user.go @@ -396,6 +396,7 @@ func (user *User) monitorSession(ce *CommandEvent) { } else { ce.Reply("Session expired") close(user.Conn.Refresh) + leavePortals(ce) } }