Skip to content

Commit ae85c60

Browse files
committed
Fixes compatibility issue with Openfire 4.9.0
This replaces API of Openfire that was removed in Openfire 4.9.0. The plugin remains compatible with Openfire 4.8.0 and later. Fixes #200
1 parent b600767 commit ae85c60

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

changelog.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ <h1>
4444
REST API Plugin Changelog
4545
</h1>
4646

47+
<p><b>1.11.1</b> (tbd)</p>
48+
<ul>
49+
<li>[<a href='https://github.com/igniterealtime/openfire-restAPI-plugin/issues/200'>#200</a>] - Fix compatibility issue with Openfire 4.9.0.</li>
50+
</ul>
51+
4752
<p><b>1.11.0</b> June 25, 2024</p>
4853
<ul>
4954
<li>Now requires Openfire 4.8.0 or later</li>

plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<description>Allows administration over a RESTful API.</description>
77
<author>Roman Soldatow</author>
88
<version>${project.version}</version>
9-
<date>2024-06-25</date>
9+
<date>2024-10-04</date>
1010
<minServerVersion>4.8.0</minServerVersion>
1111
<adminconsole>
1212
<tab id="tab-server">

src/java/org/jivesoftware/openfire/plugin/rest/controller/SessionController.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022.
2+
* Copyright (c) 2022-2024 Ignite Realtime Foundation.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -130,14 +130,14 @@ private SessionEntities convertToSessionEntities(Collection<ClientSession> clien
130130
}
131131

132132
String status = "";
133-
if (clientSession.getStatus() == Session.STATUS_CLOSED) {
133+
if (clientSession.getStatus() == Session.Status.CLOSED) {
134134
status = "Closed";
135-
} else if (clientSession.getStatus() == Session.STATUS_CONNECTED) {
135+
} else if (clientSession.getStatus() == Session.Status.CONNECTED) {
136136
status = "Connected";
137-
} else if (clientSession.getStatus() == Session.STATUS_AUTHENTICATED) {
137+
} else if (clientSession.getStatus() == Session.Status.AUTHENTICATED) {
138138
status = "Authenticated";
139139
} else {
140-
status = "Unkown";
140+
status = "Unknown";
141141
}
142142
session.setSessionStatus(status);
143143

@@ -170,7 +170,7 @@ private SessionEntities convertToSessionEntities(Collection<ClientSession> clien
170170

171171
session.setCreationDate(clientSession.getCreationDate());
172172
session.setLastActionDate(clientSession.getLastActiveDate());
173-
session.setSecure(clientSession.isSecure());
173+
session.setSecure(clientSession.isEncrypted());
174174

175175
sessions.add(session);
176176
}

0 commit comments

Comments
 (0)