Skip to content

Commit

Permalink
Merge pull request #8 from igniterealtime/of-5.0.0-chnages
Browse files Browse the repository at this point in the history
First attempt at making plugin compatible with OF 5.0
  • Loading branch information
deleolajide authored Nov 21, 2024
2 parents f36d14e + f418d91 commit a39c068
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
6 changes: 6 additions & 0 deletions changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ <h1>
LLaMA Plugin Changelog
</h1>

<p><b>0.2.0</b> -- November 18, 2024</p>

<ul>
<li>Made compatible with Openfire 5.0.0</li>
</ul>

<p><b>0.1.0</b> -- October 8, 2024</p>

<ul>
Expand Down
4 changes: 2 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<description>${project.description}</description>
<version>${project.version}</version>
<licenseType>Apache 2.0</licenseType>
<date>2023-12-31</date>
<minServerVersion>4.8.0</minServerVersion>
<date>2024-11-18</date>
<minServerVersion>5.0.0</minServerVersion>

<adminconsole>
<tab id="tab-webclients" name="${admin.sidebar.webclients.name}" description="${admin.sidebar.webclients.description}" url="llama-settings.jsp">
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<artifactId>plugins</artifactId>
<groupId>org.igniterealtime.openfire</groupId>
<version>4.9.0</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<groupId>org.igniterealtime.openfire</groupId>
Expand Down Expand Up @@ -66,8 +66,8 @@
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jspc-maven-plugin</artifactId>
<groupId>org.eclipse.jetty.ee8</groupId>
<artifactId>jetty-ee8-jspc-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand Down
14 changes: 10 additions & 4 deletions src/java/org/ifsoft/llama/openfire/LLaMA.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import org.jivesoftware.util.PropertyEventListener;
import org.jivesoftware.util.StringUtils;

/*
import org.eclipse.jetty.apache.jsp.JettyJasperInitializer;
import org.eclipse.jetty.plus.annotation.ContainerInitializer;
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
Expand All @@ -63,6 +64,9 @@
import org.eclipse.jetty.util.security.*;
import org.eclipse.jetty.security.*;
import org.eclipse.jetty.security.authentication.*;
*/

import org.eclipse.jetty.ee8.webapp.WebAppContext;

import java.lang.reflect.*;
import java.util.*;
Expand Down Expand Up @@ -206,11 +210,13 @@ private void startJSP(File pluginDirectory) {
jspService.setClassLoader(this.getClass().getClassLoader());
jspService.getMimeTypes().addMimeMapping("wasm", "application/wasm");

/*
final List<ContainerInitializer> initializers = new ArrayList<>();
initializers.add(new ContainerInitializer(new JettyJasperInitializer(), null));
jspService.setAttribute("org.eclipse.jetty.containerInitializers", initializers);
jspService.setAttribute(InstanceManager.class.getName(), new SimpleInstanceManager());

*/

Log.info("LLaMA jsp service enabled");
HttpBindManager.getInstance().addJettyHandler(jspService);
}
Expand Down Expand Up @@ -426,10 +432,10 @@ public void messageReceived(JID roomJID, JID user, String nickname, Message mess
final MUCRoom mucRoom = XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService("conference").getChatRoom(room);
boolean isOccupant = false;

for (MUCRole role : mucRoom.getOccupants()) {
Log.info("matching room occupant " + role.getUserAddress() + " with " + llamaUser );
for (MUCOccupant occupant : mucRoom.getOccupants()) {
Log.info("matching room occupant " + occupant.getUserAddress() + " with " + llamaUser );

if (role.getUserAddress().getNode().equals(llamaUser)) {
if (occupant.getUserAddress().getNode().equals(llamaUser)) {
isOccupant = true;
break;
}
Expand Down

0 comments on commit a39c068

Please sign in to comment.