diff options
Diffstat (limited to 'cmd_user.go')
-rw-r--r-- | cmd_user.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd_user.go b/cmd_user.go index 4c4c86a..bf8df64 100644 --- a/cmd_user.go +++ b/cmd_user.go @@ -12,20 +12,20 @@ func handleClientUser(msg RMsg, client *Client) error { if len(msg.Params) < 4 { return client.Send(MakeMsg(self, ERR_NEEDMOREPARAMS, "USER", "Not enough parameters")) } - switch client.State { - case ClientStatePreRegistration: + switch { + case client.State < ClientStateRegistered: client.Ident = "~" + msg.Params[0] client.Gecos = msg.Params[3] err := client.checkRegistration() if err != nil { return err } - case ClientStateRegistered: + case client.State == ClientStateRegistered: err := client.Send(MakeMsg(self, ERR_ALREADYREGISTERED, client.Nick, "You may not reregister")) if err != nil { return err } - case ClientStateRemote: + case client.State == ClientStateRemote: } return nil } |