Changeset 736 in code for trunk/upstream.go
- Timestamp:
- Dec 2, 2021, 4:33:11 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/upstream.go
r732 r736 40 40 } 41 41 42 type registrationError string 42 type registrationError struct { 43 *irc.Message 44 } 43 45 44 46 func (err registrationError) Error() string { 45 return fmt.Sprintf("registration error: %v", string(err)) 47 return fmt.Sprintf("registration error (%v): %v", err.Command, err.Reason()) 48 } 49 50 func (err registrationError) Reason() string { 51 if len(err.Params) > 0 { 52 return err.Params[len(err.Params)-1] 53 } 54 return err.Command 55 } 56 57 func (err registrationError) Temporary() bool { 58 // Only return false if we're 100% sure that fixing the error requires a 59 // network configuration change 60 return err.Command != irc.ERR_PASSWDMISMATCH && err.Command != irc.ERR_ERRONEUSNICKNAME 46 61 } 47 62 … … 1652 1667 case irc.ERR_PASSWDMISMATCH, irc.ERR_ERRONEUSNICKNAME, irc.ERR_NICKNAMEINUSE, irc.ERR_NICKCOLLISION, irc.ERR_UNAVAILRESOURCE, irc.ERR_NOPERMFORHOST, irc.ERR_YOUREBANNEDCREEP: 1653 1668 if !uc.registered { 1654 text := msg.Params[len(msg.Params)-1] 1655 return registrationError(text) 1669 return registrationError{msg} 1656 1670 } 1657 1671 fallthrough
Note:
See TracChangeset
for help on using the changeset viewer.