public void sendPublicMessage(Message message, MUCOccupant sender) throws ForbiddenException {
        // Check that if the room is moderated then the sender of the message has to have voice
        if (isModerated() && sender.getRole().compareTo(Role.participant) > 0) {
            throw new ForbiddenException();
        }
        // Send the message to all occupants
        message.setFrom(sender.getOccupantJID());
        if (canAnyoneDiscoverJID) {
            addRealJidToMessage(message, sender);
        }
        send(message, sender);
        // Fire event that message was received by the room
        MUCEventDispatcher.messageReceived(getSelfRepresentation().getOccupantJID(), sender.getUserAddress(),
            sender.getNickname(), message);
    }
Sends a message to the all the occupants. In a moderated room, this privilege is restricted
to occupants with a role of participant or higher. In an unmoderated room, any occupant can
send a message to all other occupants.

@param message The message to send (cannot be {@code null}).
@param sender the occupant data of the user that is trying to send a public message (cannot be {@code null}).
@throws ForbiddenException If the user is not allowed to send a public message (i.e. does not
            have voice in the room).
xmppserver/src/main/java/org/jivesoftware/openfire/muc/MUCRoom.java