CAP: Correctly suspend registration for CAP REQ as per the spec

This commit is contained in:
Daniel Oaks 2017-12-28 13:50:42 +10:00
parent 342a84ba3f
commit 713fc59691
1 changed files with 4 additions and 0 deletions

View File

@ -67,6 +67,10 @@ func capHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
client.Send(nil, server.name, "CAP", client.nick, subCommand, client.capabilities.String(caps.Cap301, CapValues)) // values not sent on LIST so force 3.1 client.Send(nil, server.name, "CAP", client.nick, subCommand, client.capabilities.String(caps.Cap301, CapValues)) // values not sent on LIST so force 3.1
case "REQ": case "REQ":
if !client.registered {
client.capState = CapNegotiating
}
// make sure all capabilities actually exist // make sure all capabilities actually exist
for _, capability := range capabilities.List() { for _, capability := range capabilities.List() {
if !SupportedCapabilities.Has(capability) { if !SupportedCapabilities.Has(capability) {