Skip to content

Commit

Permalink
only send "Back to normal" if "Notify Back To Normal" is enabled
Browse files Browse the repository at this point in the history
send a "Success" even if the previous build failed, if only "Notify
Success" is enabled but "Notify Back To Normal" is disabled.
  • Loading branch information
Benjamin Neff committed Mar 14, 2016
1 parent 5149c5a commit db4738c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/jenkins/plugins/slack/ActiveNotifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public MessageBuilder appendStatusMessage() {
return this;
}

static String getStatusMessage(AbstractBuild r) {
private String getStatusMessage(AbstractBuild r) {
if (r.isBuilding()) {
return STARTING_STATUS_MESSAGE;
}
Expand Down Expand Up @@ -279,7 +279,7 @@ static String getStatusMessage(AbstractBuild r) {
*/
if (result == Result.SUCCESS
&& (previousResult == Result.FAILURE || previousResult == Result.UNSTABLE)
&& buildHasSucceededBefore) {
&& buildHasSucceededBefore && notifier.getNotifyBackToNormal()) {
return BACK_TO_NORMAL_STATUS_MESSAGE;
}
if (result == Result.FAILURE && previousResult == Result.FAILURE) {
Expand Down

0 comments on commit db4738c

Please sign in to comment.