From ce1185f41b0030b514d384ef4f98234df57f79c0 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Mon, 22 Jan 2024 10:33:46 +0100 Subject: [PATCH 1/4] IRCPrivateChat.java: make "connection" field final; fix small typo Signed-off-by: Jim Klimov --- src/main/java/hudson/plugins/ircbot/v2/IRCPrivateChat.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/hudson/plugins/ircbot/v2/IRCPrivateChat.java b/src/main/java/hudson/plugins/ircbot/v2/IRCPrivateChat.java index fd09e69f..adfc9d05 100644 --- a/src/main/java/hudson/plugins/ircbot/v2/IRCPrivateChat.java +++ b/src/main/java/hudson/plugins/ircbot/v2/IRCPrivateChat.java @@ -14,7 +14,7 @@ public class IRCPrivateChat implements IMChat { private final PircListener listener; private final String nick; private final String chatPartner; - private IRCConnection connection; + private final IRCConnection connection; public IRCPrivateChat(IRCConnection connection, PircListener listener, String nick, String chatPartner) { this.connection = connection; @@ -38,7 +38,7 @@ public boolean isMultiUserChat() { return false; } - //@Overrid + //@Override public boolean isCommandsAccepted() { return true; } From 2c45e5e2aa8aa330e7061409645e0ebd4f307329 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Mon, 22 Jan 2024 10:36:03 +0100 Subject: [PATCH 2/4] IRCChannel.java: make "connection" and "commandsAccepted" fields final; fix small typo Signed-off-by: Jim Klimov --- src/main/java/hudson/plugins/ircbot/v2/IRCChannel.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/hudson/plugins/ircbot/v2/IRCChannel.java b/src/main/java/hudson/plugins/ircbot/v2/IRCChannel.java index cba46653..af79cd0e 100644 --- a/src/main/java/hudson/plugins/ircbot/v2/IRCChannel.java +++ b/src/main/java/hudson/plugins/ircbot/v2/IRCChannel.java @@ -13,8 +13,8 @@ public class IRCChannel implements IMChat { private final String channelName; private final PircListener listener; - private IRCConnection connection; - private boolean commandsAccepted; + private final IRCConnection connection; + private final boolean commandsAccepted; public IRCChannel(String channelName, IRCConnection connection, PircListener listener, boolean commandsAccepted) { this.channelName = channelName; @@ -38,7 +38,7 @@ public boolean isMultiUserChat() { return true; } - //@Overrid + //@Override public boolean isCommandsAccepted() { return this.commandsAccepted; } From 9c05b7d389b4713038d8709a3dccde0227605256 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Mon, 22 Jan 2024 11:53:34 +0100 Subject: [PATCH 3/4] IRCConnection.java: utilize new instant-messaging-plugin API for Bot to not require a commandPrefix (on IRCPrivateChat) [JENKINS-17380, JENKINS-58927] Signed-off-by: Jim Klimov --- pom.xml | 2 +- .../hudson/plugins/ircbot/v2/IRCConnection.java | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index a8ef87cd..c8596a99 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ org.jvnet.hudson.plugins instant-messaging - 2.698.ve71a_06c95cec + 2.768.v82b_9ec69388f diff --git a/src/main/java/hudson/plugins/ircbot/v2/IRCConnection.java b/src/main/java/hudson/plugins/ircbot/v2/IRCConnection.java index 801aff65..c4d3a81a 100644 --- a/src/main/java/hudson/plugins/ircbot/v2/IRCConnection.java +++ b/src/main/java/hudson/plugins/ircbot/v2/IRCConnection.java @@ -486,10 +486,15 @@ public void onMessage(IMMessage message) { return; } - IRCPrivateChat chat = new IRCPrivateChat(IRCConnection.this, listener, descriptor.getUserName(), message.getFrom()); - Bot bot = new Bot(chat, - descriptor.getNick(), descriptor.getHost(), - descriptor.getCommandPrefix(), authentication); + IRCPrivateChat chat = new IRCPrivateChat( + IRCConnection.this, listener, + descriptor.getUserName(), message.getFrom()); + Bot bot = new Bot( + chat, + descriptor.getNick(), descriptor.getHost(), + descriptor.getCommandPrefix(), authentication, + false // Tell the bot to accept all messages, not requiring a prefix (still parsing it away if present) + ); privateChats.put(message.getFrom(), bot); From 03ec6682757f1d5702ff21535512b05f19379948 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Mon, 22 Jan 2024 13:27:57 +0100 Subject: [PATCH 4/4] pom.xml, Jenkinsfile: bump required jenkins core version Signed-off-by: Jim Klimov --- Jenkinsfile | 6 +++--- pom.xml | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index dba5a3e4..19ee7c49 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,10 +6,10 @@ buildPlugin( useContainerAgent: true, configurations: [ // Test the common case (i.e., a recent LTS release) on both Linux and Windows. - [ platform: 'linux', jdk: '11', jenkins: '2.375.1' ], - [ platform: 'windows', jdk: '11', jenkins: '2.375.1' ], + [ platform: 'linux', jdk: '11', jenkins: '2.387.3' ], + [ platform: 'windows', jdk: '11', jenkins: '2.387.3' ], // Test the bleeding edge of the compatibility spectrum (i.e., the latest supported Java runtime). // see also https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ - [ platform: 'linux', jdk: '17', jenkins: '2.375.2' ], + [ platform: 'linux', jdk: '17', jenkins: '2.426.2' ], ]) diff --git a/pom.xml b/pom.xml index c8596a99..048fb659 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 3 999999-SNAPSHOT jenkinsci/${project.artifactId}-plugin - 2.375.1 + 2.387.3 Max Low @@ -42,8 +42,8 @@ io.jenkins.tools.bom - bom-2.375.x - 2198.v39c76fc308ca + bom-2.387.x + 2543.vfb_1a_5fb_9496d import pom @@ -64,7 +64,7 @@ org.jvnet.hudson.plugins instant-messaging - 2.768.v82b_9ec69388f + 2.772.vb_93c35128ff9