Skip to content

Commit

Permalink
fixes #222: Don't use deprecated Openfire methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Fishbowler committed Mar 12, 2022
1 parent 1d255b9 commit 969ed3b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ private String formatJID(boolean html, JID jid) {
if (html) {
UserManager userManager = UserManager.getInstance();
if (XMPPServer.getInstance().isLocal(jid) &&
userManager.isRegisteredUser(jid.getNode())) {
userManager.isRegisteredUser(jid, true)) {
formattedJID = "<a href='/user-properties.jsp?username=" +
jid.getNode() + "'>" + jid.toBareJID() + "</a>";
}
Expand Down
3 changes: 2 additions & 1 deletion src/java/org/jivesoftware/openfire/index/LuceneIndexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,8 @@ private XMLProperties loadPropertiesFile( File searchDir ) throws IOException
}
// Ignore.
}
return new XMLProperties(indexPropertiesFile);
InputStream stream = new FileInputStream(indexPropertiesFile);
return new XMLProperties(stream);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/java/org/jivesoftware/openfire/plugin/service/LogAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public Response getLoggedServiceNames()

final List<MultiUserChatService> multiUserChatServices = XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatServices();
final List<String> serviceNames = multiUserChatServices.stream()
.filter(s -> s.getChatRooms().stream().anyMatch(r -> r.isLogEnabled() && r.isPublicRoom()))
.filter(s -> s.getActiveChatRooms().stream().anyMatch(r -> r.isLogEnabled() && r.isPublicRoom()))
.map(MultiUserChatService::getServiceName)
.collect(Collectors.toList() );

Expand All @@ -88,7 +88,7 @@ public Response getLoggedServiceNames( @PathParam("serviceName") String serviceN
return Response.noContent().build();
}

final List<String> roomNames = multiUserChatService.getChatRooms().stream()
final List<String> roomNames = multiUserChatService.getActiveChatRooms().stream()
.filter( r -> r.isLogEnabled() && r.isPublicRoom() )
.map( MUCRoom::getName )
.collect(Collectors.toList() );
Expand Down

0 comments on commit 969ed3b

Please sign in to comment.