Skip to content

Commit

Permalink
Fix for archive search with password protected chatrooms
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsKr authored and guusdk committed Jul 2, 2018
1 parent 91b1dd5 commit 5b5b864
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/plugins/monitoring/changelog.html
Expand Up @@ -44,6 +44,11 @@ <h1>
Monitoring Plugin Changelog
</h1>

<p><b>1.6.1</b> -- June 28, 2018</p>
<ul>
<li>Fix for archive search with password protected chatrooms.</li>
</ul>

<p><b>1.6.0</b> -- March 5, 2018</p>
<ul>
<li>[<a href='https://issues.igniterealtime.org/browse/OF-1486'>OF-1486</a>] - MAM RSM queries for MUC should allow for 'backwards-paging'.</li>
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/monitoring/plugin.xml
Expand Up @@ -5,7 +5,7 @@
<name>Monitoring Service</name>
<description>Monitors conversations and statistics of the server.</description>
<author>IgniteRealtime // Jive Software</author>
<version>1.6.0</version>
<version>1.6.1</version>
<date>03/05/2018</date>
<minServerVersion>4.1.0</minServerVersion>
<databaseKey>monitoring</databaseKey>
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/monitoring/pom.xml
Expand Up @@ -8,7 +8,7 @@
</parent>
<groupId>org.igniterealtime.openfire.plugins</groupId>
<artifactId>monitoring</artifactId>
<version>1.6.0</version>
<version>1.6.1</version>
<name>Monitoring Plugin</name>
<description>Monitors conversations and statistics of the server.</description>

Expand Down
Expand Up @@ -156,6 +156,18 @@ public IQ handleIQ( final IQ packet ) throws UnauthorizedException {
Log.debug("Unable to process query as requestor '{}' is forbidden to retrieve archive for room '{}'.", requestor, archiveJid);
return buildForbiddenResponse(packet);
}

// Password protected room
if (room.isPasswordProtected()) {
// check whether requestor is occupant in the room
MUCRole occupant = room.getOccupantByFullJID(packet.getFrom());

if (occupant == null) {
// no occupant so currently not authenticated to query archive
Log.debug("Unable to process query as requestor '{}' is currently not authenticated for this password protected room '{}'.", requestor, archiveJid);
return buildForbiddenResponse(packet);
}
}
} else if(!archiveJid.equals(requestor)) { // Not user's own
// ... disallow unless admin.
if (!XMPPServer.getInstance().getAdmins().contains(requestor)) {
Expand Down

0 comments on commit 5b5b864

Please sign in to comment.