From 6fdea28236771ee1d90a6fc959075c79939ad566 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 8 Dec 2024 13:57:25 +0800 Subject: CAP: Primitive negotiation --- cmd_user.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cmd_user.go') 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 } -- cgit v1.2.3