Skip to content
This repository was archived by the owner on Nov 26, 2018. It is now read-only.

Commit 1b86d56

Browse files
committed
Close SASL if server isn't capable
1 parent d81064e commit 1b86d56

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

network/irc/irc.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,12 @@ func (bot *ircBot) act(theLine *line.Line) {
619619
return
620620
}
621621

622+
isRefusingSasl := strings.ToUpper(theLine.Command) == "CAP" && len(theLine.Args) == 2 && strings.ToUpper(theLine.Args[1]) == "NAK"
623+
if isRefusingSasl {
624+
bot.sendSaslEnd()
625+
return
626+
}
627+
622628
isAskingForSaslPass := theLine.User == "" && strings.ToUpper(theLine.Command) == "AUTHENTICATE" && len(theLine.Args) == 1 && theLine.Args[0] == "+"
623629
if isAskingForSaslPass {
624630
bot.sendSaslPass()

0 commit comments

Comments
 (0)