diff options
Diffstat (limited to 'cmd_cap.go')
-rw-r--r-- | cmd_cap.go | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -8,15 +8,21 @@ func init() { commandHandlers["CAP"] = handleClientCap } -func handleClientCap(msg RMsg, client *Client) bool { +func handleClientCap(msg RMsg, client *Client) error { if len(msg.Params) < 1 { - client.Send(MakeMsg(self, ERR_NEEDMOREPARAMS, "CAP", "Not enough parameters")) - return true + err := client.Send(MakeMsg(self, ERR_NEEDMOREPARAMS, "CAP", "Not enough parameters")) + if err != nil { + return err + } + return nil } switch strings.ToUpper(msg.Params[0]) { case "LS": - client.Send(MakeMsg(self, "CAP", client.Nick, "LS", "sasl=PLAIN,EXTERNAL")) + err := client.Send(MakeMsg(self, "CAP", client.Nick, "LS", "sasl=PLAIN,EXTERNAL")) + if err != nil { + return err + } case "REQ": } - return true + return nil } |