Commit ee857a51 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

Shifted bulk of check for whether a request is coming from a Clearspace...

Shifted bulk of check for whether a request is coming from a Clearspace component to ClearspaceManager.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@10134 b35dd754-fafc-0310-a699-88a17e54d16e
parent b7e76cdc
......@@ -112,11 +112,7 @@ public class ClearspaceMUCEventDelegate extends MUCEventDelegate {
* @return true if the user is allowed to destroy the room.
*/
public boolean destroyingRoom(String roomName, JID userjid) {
if (userjid.getNode() == null && ClearspaceManager.getInstance().isClearspaceDomain(userjid.getDomain())) {
// This is a Clearspace domain, and therefore is permitted to destroy what it wants.
return true;
}
// We never allow destroying a room as a user, so return false.
return false;
// We never allow destroying a room as a user, but clearspace components are permitted.
return ClearspaceManager.getInstance().isClearspace(userjid);
}
}
......@@ -833,11 +833,11 @@ public class ClearspaceManager extends BasicModule implements ExternalComponentM
/**
* Returns true if a given JID represents a known Clearspace component domain.
* @param domain Domain to check.
* @return True if the specified domain is a Clearspace domain.
* @param address Address to check.
* @return True if the specified address is a Clearspace component.
*/
public boolean isClearspaceDomain(String domain) {
return clearspaces.contains(domain);
public boolean isClearspace(JID address) {
return address.getNode() == null && clearspaces.contains(address.getDomain());
}
/**
......
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