aboutsummaryrefslogtreecommitdiff
path: root/clients.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2024-12-08 10:13:58 +0800
committerRunxi Yu <me@runxiyu.org>2024-12-08 10:13:58 +0800
commit7fe8fe6c9fff814b88929026384f1851ff321781 (patch)
tree3e79a8579d06047519f1f19843dcc74579060970 /clients.go
parentClient teardown and proper nick changes (diff)
downloadmeseircd-7fe8fe6c9fff814b88929026384f1851ff321781.tar.gz
meseircd-7fe8fe6c9fff814b88929026384f1851ff321781.tar.zst
meseircd-7fe8fe6c9fff814b88929026384f1851ff321781.zip
Registration
Diffstat (limited to '')
-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 (