From 038556b4aec13737fcdee9da4a45bc2c7b31e590 Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Thu, 14 Nov 2024 11:56:30 +0100 Subject: [PATCH] fixes #22: Compatibility with Openfire 4.9.0 and later In Openfire 4.9.0, a deprecated API was removed that was used by this plugin. This commit replaces that usage with usage of an API that was introduced in Openfire 4.8.0. As a result, this plugin now requires Openfire 4.8.0 or later. As the plugin no longer is compatible with older versions of Openfire, a backwards-compatibily hack for JSP compilation was removed. --- changelog.html | 4 ++- plugin.xml | 4 +-- pom.xml | 11 +------ .../jasper/runtime/JspSourceImports.java | 30 ------------------- .../openfire/plugin/MotDPlugin.java | 3 +- 5 files changed, 8 insertions(+), 44 deletions(-) delete mode 100644 src/java/org/apache/jasper/runtime/JspSourceImports.java diff --git a/changelog.html b/changelog.html index dada08dcc..feee57a46 100644 --- a/changelog.html +++ b/changelog.html @@ -44,11 +44,13 @@

MotD Plugin Changelog

1.2.5 -- To Be Determined

1.2.4 -- November 21, 2023

diff --git a/plugin.xml b/plugin.xml index fc99dfe74..e8d0f0b85 100644 --- a/plugin.xml +++ b/plugin.xml @@ -6,8 +6,8 @@ Allows admins to have a message sent to users each time they log in. Ryan Graham ${project.version} - 2022-11-21 - 4.0.0 + 2024-11-14 + 4.8.0 1.8 diff --git a/pom.xml b/pom.xml index 7586ba735..ede9532e8 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ plugins org.igniterealtime.openfire - 4.3.0 + 4.8.0 org.igniterealtime.openfire.plugins motd @@ -48,15 +48,6 @@ org.eclipse.jetty jetty-jspc-maven-plugin - - 9.2.14.v20151106 - - - org.igniterealtime.openfire - xmppserver - ${openfire.version} - - diff --git a/src/java/org/apache/jasper/runtime/JspSourceImports.java b/src/java/org/apache/jasper/runtime/JspSourceImports.java deleted file mode 100644 index 09f58d822..000000000 --- a/src/java/org/apache/jasper/runtime/JspSourceImports.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.jasper.runtime; - -import java.util.Set; - -/** - * The EL engine needs access to the imports used in the JSP page to configure - * the ELContext. The imports are available at compile time but the ELContext - * is created lazily per page. This interface exposes the imports at runtime so - * that they may be added to the ELContext when it is created. - */ -public interface JspSourceImports { - Set getPackageImports(); - Set getClassImports(); -} diff --git a/src/java/org/jivesoftware/openfire/plugin/MotDPlugin.java b/src/java/org/jivesoftware/openfire/plugin/MotDPlugin.java index aae05a479..110a98bde 100644 --- a/src/java/org/jivesoftware/openfire/plugin/MotDPlugin.java +++ b/src/java/org/jivesoftware/openfire/plugin/MotDPlugin.java @@ -1,6 +1,7 @@ package org.jivesoftware.openfire.plugin; import java.io.File; +import java.time.Duration; import java.util.TimerTask; import org.jivesoftware.util.JiveGlobals; @@ -85,7 +86,7 @@ public void run() { } }; - TaskEngine.getInstance().schedule(messageTask, 5000); + TaskEngine.getInstance().schedule(messageTask, Duration.ofSeconds(5)); } }