diff options
author | Runxi Yu <me@runxiyu.org> | 2024-12-08 10:13:58 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2024-12-08 10:13:58 +0800 |
commit | 7fe8fe6c9fff814b88929026384f1851ff321781 (patch) | |
tree | 3e79a8579d06047519f1f19843dcc74579060970 /cmd_user.go | |
parent | Client teardown and proper nick changes (diff) | |
download | meseircd-7fe8fe6c9fff814b88929026384f1851ff321781.tar.gz meseircd-7fe8fe6c9fff814b88929026384f1851ff321781.tar.zst meseircd-7fe8fe6c9fff814b88929026384f1851ff321781.zip |
Registration
Diffstat (limited to 'cmd_user.go')
-rw-r--r-- | cmd_user.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/cmd_user.go b/cmd_user.go new file mode 100644 index 0000000..99d9027 --- /dev/null +++ b/cmd_user.go @@ -0,0 +1,22 @@ +package main + +import ( +// "log/slog" +) + +func init() { + commandHandlers["USER"] = handleClientUser +} + +func handleClientUser(msg RMsg, client *Client) bool { + if len(msg.Params) < 4 { + client.Send(MakeMsg(self, ERR_NEEDMOREPARAMS, "USER", "Not enough parameters")) + return true + } + client.Ident = "~" + msg.Params[0] + client.Gecos = msg.Params[3] + if client.State == ClientStatePreRegistration { + client.checkRegistration() + } + return true +} |