Changeset 724 in code for trunk/upstream.go
- Timestamp:
- Nov 21, 2021, 3:10:54 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/upstream.go
r722 r724 32 32 "message-tags": true, 33 33 "multi-prefix": true, 34 "sasl": true, 34 35 "server-time": true, 35 36 "setname": true, … … 294 295 Params: []string{dc.nick, mask, "End of /WHO"}, 295 296 }) 297 case "AUTHENTICATE": 298 dc.endSASL(&irc.Message{ 299 Prefix: dc.srv.prefix(), 300 Command: irc.ERR_SASLABORTED, 301 Params: []string{dc.nick, "SASL authentication aborted"}, 302 }) 296 303 default: 297 304 panic(fmt.Errorf("Unsupported pending command %q", pendingCmd.msg.Command)) … … 312 319 func (uc *upstreamConn) enqueueCommand(dc *downstreamConn, msg *irc.Message) { 313 320 switch msg.Command { 314 case "LIST", "WHO" :321 case "LIST", "WHO", "AUTHENTICATE": 315 322 // Supported 316 323 default: … … 613 620 uc.saslStarted = false 614 621 615 uc.SendMessage(&irc.Message{ 616 Command: "CAP", 617 Params: []string{"END"}, 618 }) 622 if dc, _ := uc.dequeueCommand("AUTHENTICATE"); dc != nil && dc.sasl != nil { 623 if msg.Command == irc.RPL_SASLSUCCESS { 624 uc.network.autoSaveSASLPlain(context.TODO(), dc.sasl.plainUsername, dc.sasl.plainPassword) 625 } 626 627 dc.endSASL(msg) 628 } 629 630 if !uc.registered { 631 uc.SendMessage(&irc.Message{ 632 Command: "CAP", 633 Params: []string{"END"}, 634 }) 635 } 619 636 case irc.RPL_WELCOME: 620 637 uc.registered = true … … 1705 1722 } 1706 1723 1707 if uc.requestSASL() && !uc.caps["sasl"] {1708 requestCaps = append(requestCaps, "sasl")1709 }1710 1711 1724 if len(requestCaps) == 0 { 1712 1725 return … … 1750 1763 switch name { 1751 1764 case "sasl": 1765 if !uc.requestSASL() { 1766 return nil 1767 } 1752 1768 if !ok { 1753 1769 uc.logger.Printf("server refused to acknowledge the SASL capability")
Note:
See TracChangeset
for help on using the changeset viewer.