Handle registration failures

References: https://todo.sr.ht/~emersion/soju/30

git-svn-id: file:///srv/svn/repo/suika/trunk@342 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This commit is contained in:
contact 2020-06-29 15:52:49 +00:00
parent 8bf8de560b
commit 929f7b48c6

View File

@ -1335,6 +1335,11 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
// Ignore
case irc.RPL_STATSVLINE, rpl_statsping, irc.RPL_STATSBLINE, irc.RPL_STATSDLINE:
// Ignore
case irc.ERR_PASSWDMISMATCH, irc.ERR_ERRONEUSNICKNAME, irc.ERR_NICKNAMEINUSE, irc.ERR_NICKCOLLISION, irc.ERR_UNAVAILRESOURCE:
if !uc.registered {
return fmt.Errorf("registration failed: %v", msg.Params[len(msg.Params) - 1])
}
fallthrough
default:
uc.logger.Printf("unhandled message: %v", msg)
if downstreamID != 0 {