From db4738c092fc2bdf256f665dc181dbb6b4450848 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Thu, 10 Dec 2015 16:35:20 +0100 Subject: [PATCH] only send "Back to normal" if "Notify Back To Normal" is enabled send a "Success" even if the previous build failed, if only "Notify Success" is enabled but "Notify Back To Normal" is disabled. --- src/main/java/jenkins/plugins/slack/ActiveNotifier.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/jenkins/plugins/slack/ActiveNotifier.java b/src/main/java/jenkins/plugins/slack/ActiveNotifier.java index 03ab2ecd..2440ad7c 100755 --- a/src/main/java/jenkins/plugins/slack/ActiveNotifier.java +++ b/src/main/java/jenkins/plugins/slack/ActiveNotifier.java @@ -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; } @@ -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) {