use a list of capabilities instead, as the spec defines space seperated caps

This commit is contained in:
Jake Bailey 2016-01-11 16:50:32 -06:00
parent 32ae1211bb
commit 73f523f252
1 changed files with 3 additions and 3 deletions

View File

@ -294,10 +294,10 @@ func (conn *Conn) Pong(message string) { conn.Raw(PONG + " :" + message) }
// Cap sends a CAP command to the server.
// CAP subcommand
// CAP subcommand :message
func (conn *Conn) Cap(subcommmand string, message ...string) {
if len(message) == 0 {
func (conn *Conn) Cap(subcommmand string, capabilities ...string) {
if len(capabilities) == 0 {
conn.Raw(CAP + " " + subcommmand)
} else {
conn.Raw(CAP + " " + subcommmand + " :" + message[0])
conn.Raw(CAP + " " + subcommmand + " :" + strings.Join(capabilities, " "))
}
}