aboutsummaryrefslogtreecommitdiff
path: root/clients.go
diff options
context:
space:
mode:
Diffstat (limited to 'clients.go')
-rw-r--r--clients.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/clients.go b/clients.go
index 53fd134..15512c0 100644
--- a/clients.go
+++ b/clients.go
@@ -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 (