Permalink
Browse files

play sounds on fail and success

  • Loading branch information...
1 parent b7dc78d commit a26c9b841ab9fcf5e9d65ed66b6cb5f779b19555 @hpoydar committed Oct 20, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/main/java/hudson/plugins/campfire/CampfireNotifier.java
@@ -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 {

0 comments on commit a26c9b8

Please sign in to comment.