Commit 550f7aca authored by Guus der Kinderen's avatar Guus der Kinderen

Merge pull request #541 from dchinmay/dev2

Outcasts should not be allowed to register with room.
parents dc84c195 7963d3f8
......@@ -29,6 +29,7 @@ import org.dom4j.Element;
import org.dom4j.QName;
import org.jivesoftware.openfire.muc.ConflictException;
import org.jivesoftware.openfire.muc.ForbiddenException;
import org.jivesoftware.openfire.muc.MUCRole;
import org.jivesoftware.openfire.muc.MUCRoom;
import org.jivesoftware.openfire.muc.MultiUserChatService;
import org.jivesoftware.util.ElementUtil;
......@@ -126,8 +127,11 @@ class IQMUCRegisterHandler {
reply.setError(PacketError.Condition.item_not_found);
return reply;
}
else if (!room.isRegistrationEnabled()) {
// The room does not accept users to register
else if (!room.isRegistrationEnabled() ||
(packet.getFrom() != null &&
MUCRole.Affiliation.outcast == room.getAffiliation(packet.getFrom().asBareJID()))) {
// The room does not accept users to register or
// the user is an outcast and is not allowed to register
reply = IQ.createResultIQ(packet);
reply.setChildElement(packet.getChildElement().createCopy());
reply.setError(PacketError.Condition.not_allowed);
......
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