diff options
author | Runxi Yu <me@runxiyu.org> | 2024-12-08 13:57:25 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2024-12-08 13:57:25 +0800 |
commit | 6fdea28236771ee1d90a6fc959075c79939ad566 (patch) | |
tree | 0fd3e2f013729468b11d06d09283a92b98ae4358 /cmd_user.go | |
parent | tags.go: Remove erroneous MIT SPDX-License-Identifier (diff) | |
download | meseircd-6fdea28236771ee1d90a6fc959075c79939ad566.tar.gz meseircd-6fdea28236771ee1d90a6fc959075c79939ad566.tar.zst meseircd-6fdea28236771ee1d90a6fc959075c79939ad566.zip |
CAP: Primitive negotiation
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 } |