Commit 448f067c authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

Clearspace domains are now allowed to destroy rooms.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@10123 b35dd754-fafc-0310-a699-88a17e54d16e
parent 0243861c
...@@ -112,7 +112,11 @@ public class ClearspaceMUCEventDelegate extends MUCEventDelegate { ...@@ -112,7 +112,11 @@ public class ClearspaceMUCEventDelegate extends MUCEventDelegate {
* @return true if the user is allowed to destroy the room. * @return true if the user is allowed to destroy the room.
*/ */
public boolean destroyingRoom(String roomName, JID userjid) { public boolean destroyingRoom(String roomName, JID userjid) {
// We never allow destroying a room as a user, so return false always. 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; return false;
} }
} }
...@@ -831,6 +831,15 @@ public class ClearspaceManager extends BasicModule implements ExternalComponentM ...@@ -831,6 +831,15 @@ 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.
*/
public boolean isClearspaceDomain(String domain) {
return clearspaces.contains(domain);
}
/** /**
* Sends an IQ packet to the Clearspace external component and returns the IQ packet * Sends an IQ packet to the Clearspace external component and returns the IQ packet
* returned by CS or <tt>null</tt> if no answer was received before the specified * returned by CS or <tt>null</tt> if no answer was received before the specified
......
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