Handle registration failures
References: https://todo.sr.ht/~emersion/soju/30
This commit is contained in:
parent
0fa07f5f9a
commit
d26194f62d
@ -1335,6 +1335,11 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
|
|||||||
// Ignore
|
// Ignore
|
||||||
case irc.RPL_STATSVLINE, rpl_statsping, irc.RPL_STATSBLINE, irc.RPL_STATSDLINE:
|
case irc.RPL_STATSVLINE, rpl_statsping, irc.RPL_STATSBLINE, irc.RPL_STATSDLINE:
|
||||||
// Ignore
|
// 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:
|
default:
|
||||||
uc.logger.Printf("unhandled message: %v", msg)
|
uc.logger.Printf("unhandled message: %v", msg)
|
||||||
if downstreamID != 0 {
|
if downstreamID != 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user