Fix login,logout commands.

This commit is contained in:
Otto Hollmann 2022-04-02 12:04:27 +02:00
parent 2d03904646
commit 7ad214a9ad
No known key found for this signature in database
GPG Key ID: 101D022F467ECE22
1 changed files with 5 additions and 1 deletions

View File

@ -220,6 +220,10 @@ func (handler *CommandHandler) CommandLogin(ce *CommandEvent) {
ce.Reply("**Usage:** `login username password`")
return
}
if ce.User.Conn != nil && ce.User.Conn.LoggedIn == true {
ce.Reply("You're already logged into Skype.")
return
}
leavePortals(ce)
if !ce.User.Connect(true) {
ce.User.log.Debugln("Connect() returned false, assuming error was logged elsewhere and canceling login.")
@ -234,7 +238,7 @@ func (handler *CommandHandler) CommandLogin(ce *CommandEvent) {
const cmdLogoutHelp = `logout - Logout from Skype`
func (handler *CommandHandler) CommandLogout(ce *CommandEvent) {
if ce.User.Conn == nil {
if ce.User.Conn == nil || ce.User.Conn.LoggedIn == false {
ce.Reply("You're not logged into Skype.")
return
}