Skip to content

Commit

Permalink
play sounds on fail and success
Browse files Browse the repository at this point in the history
  • Loading branch information
henrypoydar committed Oct 20, 2011
1 parent b7dc78d commit a26c9b8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/hudson/plugins/campfire/CampfireNotifier.java
Expand Up @@ -110,10 +110,17 @@ private void publish(AbstractBuild<?, ?> build) throws IOException {
String resultString = result.toString();
if (!smartNotify && result == Result.SUCCESS) resultString = resultString.toLowerCase();
String message = build.getProject().getName() + " " + build.getDisplayName() + " \"" + changeString + "\": " + resultString;
if (resultString == "FAILURE") {
String message_sound = "/play trombone"
} else {
String message_sound = "/play rimshot"
}
String fail_message = build.getProject().getName() + " " + build.getDisplayName() + " \"" + changeString + "\": " + resultString;
if (hudsonUrl != null && hudsonUrl.length() > 1 && (smartNotify || result != Result.SUCCESS)) {
message = message + " (" + hudsonUrl + build.getUrl() + ")";
}
room.speak(message);
room.speak(message_sound);
}

private void checkCampfireConnection() throws IOException {
Expand Down

0 comments on commit a26c9b8

Please sign in to comment.