aboutsummaryrefslogtreecommitdiff
path: root/clients.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2024-12-08 15:17:50 +0800
committerRunxi Yu <me@runxiyu.org>2024-12-08 15:17:50 +0800
commit9e1c9c5f43e2f0cf2dd1fa29b1ba3512dbbaeb7e (patch)
treec176990b7e54b292b70dcfe1f3bed5fa1ab630a3 /clients.go
parentcommandHandlers -> CommandHandlers (diff)
downloadmeseircd-9e1c9c5f43e2f0cf2dd1fa29b1ba3512dbbaeb7e.tar.gz
meseircd-9e1c9c5f43e2f0cf2dd1fa29b1ba3512dbbaeb7e.tar.zst
meseircd-9e1c9c5f43e2f0cf2dd1fa29b1ba3512dbbaeb7e.zip
Implement SASL stub
Diffstat (limited to 'clients.go')
-rw-r--r--clients.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/clients.go b/clients.go
index 2719b08..b141cf8 100644
--- a/clients.go
+++ b/clients.go
@@ -16,6 +16,7 @@ type Client struct {
Gecos string
Host string
Caps map[string]struct{}
+ Extra map[string]any
Server Server
State ClientState
}
@@ -55,8 +56,10 @@ func (client *Client) Teardown() {
if !uidToClient.CompareAndDelete(client.UID, client) {
slog.Error("uid inconsistent", "uid", client.UID, "client", client)
}
- if !nickToClient.CompareAndDelete(client.Nick, client) {
- slog.Error("nick inconsistent", "nick", client.Nick, "client", client)
+ if (client.State >= ClientStateRegistered || client.Nick != "*") {
+ if !nickToClient.CompareAndDelete(client.Nick, client) {
+ slog.Error("nick inconsistent", "nick", client.Nick, "client", client)
+ }
}
}
@@ -67,6 +70,7 @@ func NewLocalClient(conn *net.Conn) (*Client, error) {
State: ClientStatePreRegistration,
Nick: "*",
Caps: make(map[string]struct{}),
+ Extra: make(map[string]any),
}
for range 10 {
uid_ := []byte(self.SID)