if (build.getResult() == Result.UNSTABLE) {
if (!dontNotifyEveryUnstableBuild)
return new UnstableBuildMail(getRecipients(), sendToIndividuals, upstreamProjects, getCharset()).
getMail(build, listener);
Result prev = findPreviousBuildResult(build);
if (prev == Result.SUCCESS)
return new UnstableBuildMail(getRecipients(), sendToIndividuals, upstreamProjects, getCharset()).
getMail(build, listener);
}
if (build.getResult() == Result.SUCCESS) {
Result prev = findPreviousBuildResult(build);
if (prev == Result.FAILURE)
return new BackToNormalBuildMail(getRecipients(), sendToIndividuals, upstreamProjects, getCharset(),
Messages.MailSender_BackToNormal_Normal()).getMail(build, listener);
if (prev == Result.UNSTABLE)
return new BackToNormalBuildMail(getRecipients(), sendToIndividuals, upstreamProjects, getCharset(),