aboutsummaryrefslogtreecommitdiff
path: root/cmd_cap.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 /cmd_cap.go
parentcommandHandlers -> CommandHandlers (diff)
downloadmeseircd-9e1c9c5f43e2f0cf2dd1fa29b1ba3512dbbaeb7e.tar.gz
meseircd-9e1c9c5f43e2f0cf2dd1fa29b1ba3512dbbaeb7e.tar.zst
meseircd-9e1c9c5f43e2f0cf2dd1fa29b1ba3512dbbaeb7e.zip
Implement SASL stub
Diffstat (limited to '')
-rw-r--r--cmd_cap.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/cmd_cap.go b/cmd_cap.go
index a2af228..65313a4 100644
--- a/cmd_cap.go
+++ b/cmd_cap.go
@@ -42,11 +42,17 @@ func handleClientCap(msg RMsg, client *Client) error {
}
_, ok := Caps[c]
if ok {
- client.Send(MakeMsg(self, "CAP", client.Nick, "ACK", c))
+ err := client.Send(MakeMsg(self, "CAP", client.Nick, "ACK", c))
+ if err != nil {
+ return err
+ }
client.Caps[c] = struct{}{}
// TODO: This is terrible
} else {
- client.Send(MakeMsg(self, "CAP", client.Nick, "NAK", c))
+ err := client.Send(MakeMsg(self, "CAP", client.Nick, "NAK", c))
+ if err != nil {
+ return err
+ }
}
}
case "END":
@@ -55,7 +61,10 @@ func handleClientCap(msg RMsg, client *Client) error {
return nil
}
client.State = ClientStateCapabilitiesFinished
- client.checkRegistration()
+ err := client.checkRegistration()
+ if err != nil {
+ return err
+ }
}
return nil
}