Commit d88296e5 authored by Tom Evans's avatar Tom Evans

OF-796: More tweaks for version detection

Workaround for current updateServiceUrl (version endpoint) on Ignite
website; uses old string-based version comparison
parent 53caf9f8
......@@ -539,11 +539,13 @@ public class UpdateManager extends BasicModule {
Element openfire = xmlResponse.element("openfire");
if (openfire != null) {
// A new version of openfire was found
String latestVersion = openfire.attributeValue("latest");
Version latestVersion = new Version(openfire.attributeValue("latest"));
if (latestVersion.isNewerThan(XMPPServer.getInstance().getServerInfo().getVersion())) {
String changelog = openfire.attributeValue("changelog");
String url = openfire.attributeValue("url");
// Keep information about the available server update
serverUpdate = new Update("Openfire", latestVersion, changelog, url);
serverUpdate = new Update("Openfire", latestVersion.getVersionString(), changelog, url);
}
}
// Check if we need to send notifications to admins
if (notificationsEnabled && isNotificationEnabled() && serverUpdate != null) {
......@@ -798,8 +800,8 @@ public class UpdateManager extends BasicModule {
String changelog = openfire.attributeValue("changelog");
String url = openfire.attributeValue("url");
// Check if current server version is correct
Version curentServerVersion = XMPPServer.getInstance().getServerInfo().getVersion();
if (latestVersion.isNewerThan(curentServerVersion)) {
Version currentServerVersion = XMPPServer.getInstance().getServerInfo().getVersion();
if (latestVersion.isNewerThan(currentServerVersion)) {
serverUpdate = new Update("Openfire", latestVersion.getVersionString(), changelog, url);
}
}
......
......@@ -438,14 +438,17 @@
<%
final XMPPServer server = XMPPServer.getInstance();
Version version = server.getServerInfo().getVersion();
Version serverVersion = server.getServerInfo().getVersion();
List<Plugin> outdatedPlugins = new ArrayList<Plugin>();
for (Plugin plugin : server.getPluginManager().getPlugins()) {
String pluginVersion = server.getPluginManager().getMinServerVersion(plugin);
if (pluginVersion != null && pluginVersion.compareTo(version.getVersionString()) > 0) {
if (pluginVersion != null) {
Version pluginMinServerVersion = new Version(pluginVersion);
if (pluginMinServerVersion.isNewerThan(serverVersion)) {
outdatedPlugins.add(plugin);
}
}
}
if (outdatedPlugins.size() > 0) {
%>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment