3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-10 22:19:31 +01:00

accounts: Disable reg if client's already registered an account

This commit is contained in:
Daniel Oaks 2017-08-24 00:37:08 +10:00
parent eb72c38d0c
commit d052ca8a8d

View File

@ -92,6 +92,12 @@ func accRegisterHandler(server *Server, client *Client, msg ircmsg.IrcMessage) b
return false
}
// clients can't reg new accounts if they're already logged in
if client.account != nil {
client.Send(nil, server.name, ERR_REG_UNSPECIFIED_ERROR, client.nick, "*", "You're already logged into an account")
return false
}
// get and sanitise account name
account := strings.TrimSpace(msg.Params[1])
casefoldedAccount, err := CasefoldName(account)