aboutsummaryrefslogblamecommitdiff
path: root/cmd_cap.go
blob: 328bce6732f4c0b183dc73885dc47b6a3e03d043 (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                                                
                                                      
                                




                                                                                                     
         
                                               
                  



                                                                                                  

                   
                  
 
package main

import (
	"strings"
)

func init() {
	commandHandlers["CAP"] = handleClientCap
}

func handleClientCap(msg RMsg, client *Client) error {
	if len(msg.Params) < 1 {
		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":
		err := client.Send(MakeMsg(self, "CAP", client.Nick, "LS", "sasl=PLAIN,EXTERNAL"))
		if err != nil {
			return err
		}
	case "REQ":
	}
	return nil
}