Changeset 737 in code


Ignore:
Timestamp:
Dec 2, 2021, 4:58:56 PM (4 years ago)
Author:
contact
Message:

Mark ACCOUNT_REQUIRED error as permanent connection failure

There's no point in retrying to connect in this case.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/upstream.go

    r736 r737  
    5858        // Only return false if we're 100% sure that fixing the error requires a
    5959        // network configuration change
    60         return err.Command != irc.ERR_PASSWDMISMATCH && err.Command != irc.ERR_ERRONEUSNICKNAME
     60        switch err.Command {
     61        case irc.ERR_PASSWDMISMATCH, irc.ERR_ERRONEUSNICKNAME:
     62                return false
     63        case "FAIL":
     64                return err.Params[1] != "ACCOUNT_REQUIRED"
     65        default:
     66                return true
     67        }
    6168}
    6269
     
    16191626                })
    16201627        case "FAIL":
    1621                 var command string
    1622                 if err := parseMessageParams(msg, &command); err != nil {
    1623                         return err
     1628                var command, code string
     1629                if err := parseMessageParams(msg, &command, &code); err != nil {
     1630                        return err
     1631                }
     1632
     1633                if !uc.registered && command == "*" && code == "ACCOUNT_REQUIRED" {
     1634                        return registrationError{msg}
    16241635                }
    16251636
Note: See TracChangeset for help on using the changeset viewer.