diff options
Diffstat (limited to 'clients.go')
-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 ( |