Navigation Menu

Skip to content

Commit

Permalink
[FIXED JENKINS-14467] make IRC login name configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
kutzi committed Aug 26, 2012
1 parent 0198093 commit 001daa3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/main/java/hudson/plugins/ircbot/IrcPublisher.java
Expand Up @@ -164,6 +164,8 @@ public static final class DescriptorImpl extends BuildStepDescriptor<Publisher>
Integer port = 194;

private boolean ssl;

private String login = "PircBotx";

String password = null;

Expand Down Expand Up @@ -227,6 +229,7 @@ public boolean configure(StaplerRequest req, JSONObject formData) throws FormExc
|| "true".equals(req.getParameter("irc_publisher.enabled"));
if (this.enabled) {
this.hostname = req.getParameter("irc_publisher.hostname");
this.login = req.getParameter("irc_publisher.login");
this.password = Scrambler.scramble(
req.getParameter("irc_publisher.password"));
this.nick = req.getParameter("irc_publisher.nick");
Expand Down Expand Up @@ -400,6 +403,10 @@ public String getNickServPassword() {
return Scrambler.descramble(nickServPassword);
}

public String getLogin() {
return this.login;
}

//@Override
public String getPassword() {
return Scrambler.descramble(password);
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/hudson/plugins/ircbot/v2/IRCConnection.java
Expand Up @@ -58,8 +58,6 @@ public IRCConnection(DescriptorImpl descriptor, AuthenticationHolder authenticat
if (LOGGER.isLoggable(Level.FINEST)) {
this.pircConnection.setVerbose(true);
}
// Defaults to PircBotX, but ircu doesn't allow more than two capitals.
this.pircConnection.setLogin("PircBotx");
this.descriptor = descriptor;
this.authentication = authentication;

Expand All @@ -69,6 +67,7 @@ public IRCConnection(DescriptorImpl descriptor, AuthenticationHolder authenticat
this.groupChats = Collections.emptyList();
}

this.pircConnection.setLogin(this.descriptor.getLogin());
this.pircConnection.setName(this.descriptor.getNick());

// lower delay between sending 2 messages to 500ms as we will sometimes send
Expand Down
Expand Up @@ -47,8 +47,12 @@
description="Nickname of the bot">
<f:textbox name="irc_publisher.nick" value="${descriptor.getNick()}" />
</f:entry>
<f:entry title="Login"
description="Login for the IRC server">
<f:textbox name="irc_publisher.login" value="${descriptor.getLogin()}" />
</f:entry>
<f:entry title="Password"
description="Password to the IRC server">
description="Password for the IRC server">
<f:password name="irc_publisher.password" value="${descriptor.getPassword()}" />
</f:entry>
<f:entry title="NickServ Password" description="On connection, try to identify with NickServ with this password" help="/plugin/ircbot/help-globalConfigNickServ.html">
Expand Down

0 comments on commit 001daa3

Please sign in to comment.