}
}
else {
// Room does not exist and delegate does not recognize it and does
// not allow room creation
throw new NotAllowedException();
}
}
else {
// The room does not exist so check for creation permissions
// Room creation is always allowed for sysadmin
if (isRoomCreationRestricted() && !sysadmins.contains(userjid.toBareJID())) {
// The room creation is only allowed for certain JIDs
if (!allowedToCreate.contains(userjid.toBareJID())) {
// The user is not in the list of allowed JIDs to create a room so raise
// an exception
throw new NotAllowedException();
}
}
room.addFirstOwner(userjid.toBareJID());
created = true;
}