From 3e2260dd8284b5948a6e11a9e6966dc95b9c810c Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Mon, 9 Dec 2024 06:47:18 +0800 Subject: CAP LS: Distinguish 302 --- cmd_cap.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cmd_cap.go') 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 -- cgit v1.2.3