diff --git a/downstream.go b/downstream.go index 5518e0c..50b1769 100644 --- a/downstream.go +++ b/downstream.go @@ -744,9 +744,6 @@ func (dc *downstreamConn) handleMessageUnregistered(ctx context.Context, msg *ir dc.logger.Printf("unhandled message: %v", msg) return newUnknownCommandError(msg.Command) } - if dc.registration.nick != "" && dc.registration.username != "" && !dc.registration.negotiatingCaps { - return dc.register(ctx) - } return nil } @@ -1712,6 +1709,10 @@ func (dc *downstreamConn) runUntilRegistered() error { } else if err != nil { return fmt.Errorf("failed to handle IRC command %q: %v", msg, err) } + + if dc.registration.nick != "" && dc.registration.username != "" && !dc.registration.negotiatingCaps { + return dc.register(ctx) + } } return nil