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 /clients.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 '')
-rw-r--r-- | clients.go | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -1,8 +1,8 @@ package main import ( - "net" "log/slog" + "net" "sync" ) @@ -11,6 +11,7 @@ type Client struct { UID string Nick string Ident string + Gecos string Host string Server Server State ClientState @@ -57,6 +58,16 @@ func (client *Client) Teardown() { } } +func (client *Client) checkRegistration() { + if client.State != ClientStatePreRegistration { + slog.Error("spurious call to checkRegistration", "client", client) + return // TODO: Return an error? + } + if client.Nick != "*" && client.Ident != "" { + client.Send(MakeMsg(self, RPL_WELCOME, client.Nick, "Welcome")) + } +} + type ClientState uint8 const ( |