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 001daa3 commit e81774c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -23,7 +23,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
28 changes: 20 additions & 8 deletions src/main/java/hudson/plugins/ircbot/IrcPublisher.java
Expand Up @@ -17,6 +17,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.plugins.ircbot.v2.IRCConnectionProvider;
import hudson.plugins.ircbot.v2.IRCMessageTargetConverter;
Expand Down Expand Up @@ -266,7 +267,7 @@ public boolean configure(StaplerRequest req, JSONObject formData) throws FormExc
}
this.defaultTargets = targets;

this.hudsonLogin = req.getParameter(PARAMETERNAME_HUDSON_LOGIN);
this.hudsonLogin = req.getParameter(getParamNames().getJenkinsLogin());

this.useNotice = "on".equals(req.getParameter(PARAMETERNAME_USE_NOTICE));

Expand Down Expand Up @@ -332,7 +333,7 @@ public Publisher newInstance(StaplerRequest req, JSONObject formData) throws For
}
}

String n = req.getParameter(PARAMETERNAME_STRATEGY);
String n = req.getParameter(getParamNames().getStrategy());
if (n == null) {
n = PARAMETERVALUE_STRATEGY_DEFAULT;
} else {
Expand All @@ -347,11 +348,11 @@ public Publisher newInstance(StaplerRequest req, JSONObject formData) throws For
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 @@ -482,7 +483,18 @@ public String getCharset() {
return this.charset;
}

/**


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

/**
* Deserialize old descriptors.
*/
@SuppressWarnings("deprecation")
Expand Down

0 comments on commit e81774c

Please sign in to comment.