From 7fe8fe6c9fff814b88929026384f1851ff321781 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 8 Dec 2024 10:13:58 +0800 Subject: Registration --- cmd_user.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 cmd_user.go (limited to 'cmd_user.go') 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 +} -- cgit v1.2.3