aboutsummaryrefslogtreecommitdiff
path: root/cmd_cap.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2024-12-09 06:47:18 +0800
committerRunxi Yu <me@runxiyu.org>2024-12-09 06:47:18 +0800
commit3e2260dd8284b5948a6e11a9e6966dc95b9c810c (patch)
tree053aa160bd6387592caefcee1d9579b4a9668e9e /cmd_cap.go
parentServer & Client should only have pointer receivers (diff)
downloadmeseircd-3e2260dd8284b5948a6e11a9e6966dc95b9c810c.tar.gz
meseircd-3e2260dd8284b5948a6e11a9e6966dc95b9c810c.tar.zst
meseircd-3e2260dd8284b5948a6e11a9e6966dc95b9c810c.zip
CAP LS: Distinguish 302
Diffstat (limited to 'cmd_cap.go')
-rw-r--r--cmd_cap.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd_cap.go b/cmd_cap.go
index 65313a4..c76bd57 100644
--- a/cmd_cap.go
+++ b/cmd_cap.go
@@ -24,7 +24,12 @@ func handleClientCap(msg RMsg, client *Client) error {
if client.State == ClientStatePreRegistration {
client.State = ClientStateCapabilities
}
- err := client.Send(MakeMsg(self, "CAP", client.Nick, "LS", capls))
+ var err error
+ if len(msg.Params) >= 2 && msg.Params[1] == "302" {
+ err = client.Send(MakeMsg(self, "CAP", client.Nick, "LS", capls302))
+ } else {
+ err = client.Send(MakeMsg(self, "CAP", client.Nick, "LS", capls))
+ }
// TODO: Split when too long
if err != nil {
return err