Skip to content

Commit

Permalink
Fixed incompatibility between Jabber and IRC plugin regarding configu…
Browse files Browse the repository at this point in the history
…ration parameters [JENKINS-10589]
  • Loading branch information
kutzi committed Aug 26, 2012
1 parent da69c97 commit ee1808d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>instant-messaging-parent</artifactId>
<version>1.20-SNAPSHOT</version>
<version>1.20</version>
<relativePath>../instant-messaging-parent-plugin/pom.xml</relativePath>
</parent>

Expand All @@ -29,7 +29,7 @@
</licenses>

<properties>
<version.instant-messaging.plugin>1.21</version.instant-messaging.plugin>
<version.instant-messaging.plugin>1.22</version.instant-messaging.plugin>
</properties>

<dependencies>
Expand Down
Expand Up @@ -15,6 +15,7 @@
import hudson.plugins.im.MatrixJobMultiplier;
import hudson.plugins.im.NotificationStrategy;
import hudson.plugins.im.build_notify.BuildToChatNotifier;
import hudson.plugins.im.config.ParameterNames;
import hudson.plugins.im.tools.ExceptionHelper;
import hudson.tasks.BuildStepDescriptor;
import hudson.tasks.Publisher;
Expand Down Expand Up @@ -289,7 +290,7 @@ private void applyDefaultIdSuffix(final HttpServletRequest req) {
}

private void applyHudsonLoginPassword(HttpServletRequest req) throws FormException {
this.hudsonCiLogin = Util.fixEmptyAndTrim(req.getParameter(PARAMETERNAME_HUDSON_LOGIN));
this.hudsonCiLogin = Util.fixEmptyAndTrim(req.getParameter(getParamNames().getJenkinsLogin()));

// TODO: add validation of login name, again?
// if(this.hudsonCiLogin != null) {
Expand Down Expand Up @@ -535,7 +536,7 @@ public JabberPublisher newInstance(final StaplerRequest req, JSONObject formData
throw new FormException("Invalid Jabber address", e, PARAMETERNAME_TARGETS);
}

String n = req.getParameter(PARAMETERNAME_STRATEGY);
String n = req.getParameter(getParamNames().getStrategy());
if (n == null) {
n = PARAMETERVALUE_STRATEGY_DEFAULT;
} else {
Expand All @@ -550,11 +551,11 @@ public JabberPublisher newInstance(final StaplerRequest req, JSONObject formData
n = PARAMETERVALUE_STRATEGY_DEFAULT;
}
}
boolean notifyStart = "on".equals(req.getParameter(PARAMETERNAME_NOTIFY_START));
boolean notifySuspects = "on".equals(req.getParameter(PARAMETERNAME_NOTIFY_SUSPECTS));
boolean notifyCulprits = "on".equals(req.getParameter(PARAMETERNAME_NOTIFY_CULPRITS));
boolean notifyFixers = "on".equals(req.getParameter(PARAMETERNAME_NOTIFY_FIXERS));
boolean notifyUpstream = "on".equals(req.getParameter(PARAMETERNAME_NOTIFY_UPSTREAM_COMMITTERS));
boolean notifyStart = "on".equals(req.getParameter(getParamNames().getNotifyStart()));
boolean notifySuspects = "on".equals(req.getParameter(getParamNames().getNotifySuspects()));
boolean notifyCulprits = "on".equals(req.getParameter(getParamNames().getNotifyCulprits()));
boolean notifyFixers = "on".equals(req.getParameter(getParamNames().getNotifyFixers()));
boolean notifyUpstream = "on".equals(req.getParameter(getParamNames().getNotifyUpstreamCommitters()));

MatrixJobMultiplier matrixJobMultiplier = MatrixJobMultiplier.ONLY_CONFIGURATIONS;
if (formData.has("matrixNotifier")) {
Expand Down Expand Up @@ -787,7 +788,17 @@ public List<IMMessageTarget> getDefaultTargets() {
return this.defaultTargets;
}

/**
@Override
public ParameterNames getParamNames() {
return new ParameterNames() {
@Override
protected String getPrefix() {
return PREFIX;
}
};
}

/**
* Deserialize old descriptors.
*/
private Object readResolve() {
Expand Down

0 comments on commit ee1808d

Please sign in to comment.