From 1c1f055b5a27e931f5abc86befd0af53ecf03437 Mon Sep 17 00:00:00 2001 From: Ryan Milbourne Date: Thu, 18 Jun 2015 16:03:43 -0700 Subject: [PATCH 1/2] Set `message_format` to `text` `message_format` defaults to html, which means that by default mentions, emoticons, etc etc aren't supported. With the format set to `text`, we can support mentions, emoji, url parsing, and slash commands. --- .../java/jenkins/plugins/hipchat/impl/HipChatV2Service.java | 1 + .../resources/jenkins/plugins/hipchat/Messages.properties | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/jenkins/plugins/hipchat/impl/HipChatV2Service.java b/src/main/java/jenkins/plugins/hipchat/impl/HipChatV2Service.java index aee84e3..3e45c4c 100644 --- a/src/main/java/jenkins/plugins/hipchat/impl/HipChatV2Service.java +++ b/src/main/java/jenkins/plugins/hipchat/impl/HipChatV2Service.java @@ -45,6 +45,7 @@ public void publish(String message, String color, boolean notify) { JSONObject notification = new JSONObject(); notification.put("message", message); + notification.put("message_format", "text"); notification.put("color", color); notification.put("notify", notify); post.setRequestEntity(new StringRequestEntity(notification.toString(), "application/json", "UTF-8")); diff --git a/src/main/resources/jenkins/plugins/hipchat/Messages.properties b/src/main/resources/jenkins/plugins/hipchat/Messages.properties index 0cb286b..f6ae224 100644 --- a/src/main/resources/jenkins/plugins/hipchat/Messages.properties +++ b/src/main/resources/jenkins/plugins/hipchat/Messages.properties @@ -7,12 +7,12 @@ StartWithChanges=Started by changes from {0} ({1} file(s) changed) Started=Starting... BackToNormal=Back to normal Success=Success -Failure=FAILURE +Failure=FAILURE Aborted=ABORTED NotBuilt=Not built Unstable=UNSTABLE -JobStarted=$JOB_NAME #$BUILD_NUMBER $STATUS ($CHANGES_OR_CAUSE) (Open) -JobCompleted=$JOB_NAME #$BUILD_NUMBER $STATUS after $DURATION (Open) +JobStarted=$JOB_NAME #$BUILD_NUMBER $STATUS ($CHANGES_OR_CAUSE) ($URL) +JobCompleted=$JOB_NAME #$BUILD_NUMBER $STATUS after $DURATION ($URL) Unknown=Unknown From 8b652bf702f3bab2ee90cd178985da798e32dcd6 Mon Sep 17 00:00:00 2001 From: Ryan Milbourne Date: Thu, 18 Jun 2015 16:18:29 -0700 Subject: [PATCH 2/2] Modify token fields to use `password` form control Mask the API Oauth token from users with access to Jenkins job configurations --- .../jenkins/plugins/hipchat/HipChatNotifier/config.jelly | 2 +- .../jenkins/plugins/hipchat/HipChatNotifier/global.jelly | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/jenkins/plugins/hipchat/HipChatNotifier/config.jelly b/src/main/resources/jenkins/plugins/hipchat/HipChatNotifier/config.jelly index 8a6eeab..5c1177d 100644 --- a/src/main/resources/jenkins/plugins/hipchat/HipChatNotifier/config.jelly +++ b/src/main/resources/jenkins/plugins/hipchat/HipChatNotifier/config.jelly @@ -2,7 +2,7 @@ - + diff --git a/src/main/resources/jenkins/plugins/hipchat/HipChatNotifier/global.jelly b/src/main/resources/jenkins/plugins/hipchat/HipChatNotifier/global.jelly index 90b5ab7..07972bd 100644 --- a/src/main/resources/jenkins/plugins/hipchat/HipChatNotifier/global.jelly +++ b/src/main/resources/jenkins/plugins/hipchat/HipChatNotifier/global.jelly @@ -7,7 +7,7 @@ - +