Forward unknown commands to upstream in single-upstream mode

This commit is contained in:
Simon Ser 2021-05-28 11:15:15 +02:00
parent b0b913293e
commit 0f3dd2f2b1

View File

@ -2287,7 +2287,14 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
} }
default: default:
dc.logger.Printf("unhandled message: %v", msg) dc.logger.Printf("unhandled message: %v", msg)
return newUnknownCommandError(msg.Command)
// Only forward unknown commands in single-upstream mode
uc := dc.upstream()
if uc == nil {
return newUnknownCommandError(msg.Command)
}
uc.SendMessageLabeled(dc.id, msg)
} }
return nil return nil
} }