Changeset 125 in code for trunk/downstream.go


Ignore:
Timestamp:
Mar 19, 2020, 1:51:45 PM (5 years ago)
Author:
contact
Message:

Remove some IRCv3 constants

go-irc v3.1.2 adds some missing IRCv3 constants.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/downstream.go

    r124 r125  
    398398                if !dc.caps["sasl"] {
    399399                        return ircError{&irc.Message{
    400                                 Command: err_saslfail,
     400                                Command: irc.ERR_SASLFAIL,
    401401                                Params:  []string{"*", "AUTHENTICATE requires the \"sasl\" capability to be enabled"},
    402402                        }}
     
    404404                if len(msg.Params) == 0 {
    405405                        return ircError{&irc.Message{
    406                                 Command: err_saslfail,
     406                                Command: irc.ERR_SASLFAIL,
    407407                                Params:  []string{"*", "Missing AUTHENTICATE argument"},
    408408                        }}
     
    410410                if dc.nick == "" {
    411411                        return ircError{&irc.Message{
    412                                 Command: err_saslfail,
     412                                Command: irc.ERR_SASLFAIL,
    413413                                Params:  []string{"*", "Expected NICK command before AUTHENTICATE"},
    414414                        }}
     
    425425                        default:
    426426                                return ircError{&irc.Message{
    427                                         Command: err_saslfail,
     427                                        Command: irc.ERR_SASLFAIL,
    428428                                        Params:  []string{"*", fmt.Sprintf("Unsupported SASL mechanism %q", mech)},
    429429                                }}
     
    432432                        dc.saslServer = nil
    433433                        return ircError{&irc.Message{
    434                                 Command: err_saslaborted,
     434                                Command: irc.ERR_SASLABORTED,
    435435                                Params:  []string{"*", "SASL authentication aborted"},
    436436                        }}
     
    444444                                dc.saslServer = nil
    445445                                return ircError{&irc.Message{
    446                                         Command: err_saslfail,
     446                                        Command: irc.ERR_SASLFAIL,
    447447                                        Params:  []string{"*", "Invalid base64-encoded response"},
    448448                                }}
     
    455455                        if ircErr, ok := err.(ircError); ok && ircErr.Message.Command == irc.ERR_PASSWDMISMATCH {
    456456                                return ircError{&irc.Message{
    457                                         Command: err_saslfail,
     457                                        Command: irc.ERR_SASLFAIL,
    458458                                        Params:  []string{"*", ircErr.Message.Params[1]},
    459459                                }}
     
    461461                        dc.SendMessage(&irc.Message{
    462462                                Prefix:  dc.srv.prefix(),
    463                                 Command: err_saslfail,
     463                                Command: irc.ERR_SASLFAIL,
    464464                                Params:  []string{"*", "SASL error"},
    465465                        })
     
    469469                        dc.SendMessage(&irc.Message{
    470470                                Prefix:  dc.srv.prefix(),
    471                                 Command: rpl_loggedin,
     471                                Command: irc.RPL_LOGGEDIN,
    472472                                Params:  []string{dc.nick, dc.nick, dc.user.Username, "You are now logged in"},
    473473                        })
    474474                        dc.SendMessage(&irc.Message{
    475475                                Prefix:  dc.srv.prefix(),
    476                                 Command: rpl_saslsuccess,
     476                                Command: irc.RPL_SASLSUCCESS,
    477477                                Params:  []string{dc.nick, "SASL authentication successful"},
    478478                        })
Note: See TracChangeset for help on using the changeset viewer.