This repository was archived by the owner on Nov 26, 2018. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -546,7 +546,6 @@ func (bot *ircBot) sendPassword() {
546546
547547func (bot * ircBot ) sendSaslStart () {
548548 bot .SendRaw ("AUTHENTICATE PLAIN" )
549-
550549}
551550
552551func (bot * ircBot ) sendSaslPass () {
@@ -614,19 +613,19 @@ func (bot *ircBot) act(theLine *line.Line) {
614613 return
615614 }
616615
617- isAskingForSasl := theLine .User == "" && strings .HasSuffix (theLine .Raw , " CAP * ACK : sasl")
616+ isAskingForSasl := strings . ToUpper ( theLine .Command ) == "CAP " && len ( theLine . Args ) == 2 && strings .ToUpper (theLine .Args [ 1 ]) == "ACK" && theLine . Content == " sasl"
618617 if isAskingForSasl {
619618 bot .sendSaslStart ()
620619 return
621620 }
622621
623- isAskingForSaslPass := theLine .User == "" && theLine .Raw == "AUTHENTICATE +"
622+ isAskingForSaslPass := theLine .User == "" && strings . ToUpper ( theLine .Command ) == "AUTHENTICATE" && theLine . Args [ 0 ] == " +"
624623 if isAskingForSaslPass {
625624 bot .sendSaslPass ()
626625 return
627626 }
628627
629- isSaslConfirm := theLine .User == "" && theLine .Content == "SASL authentication successful "
628+ isSaslConfirm := theLine .User == "" && theLine .Command == "903 "
630629 // After SASL is accepted, join all the channels
631630 if isSaslConfirm {
632631 bot .sendSaslEnd ()
You can’t perform that action at this time.
0 commit comments