public void changeSubject(Message packet, MUCOccupant actor) throws ForbiddenException {
        if ((canOccupantsChangeSubject() && actor.getRole().compareTo(Role.visitor) < 0) ||
            Role.moderator == actor.getRole()) {
            // Set the new subject to the room
            subject = packet.getSubject();
            MUCPersistenceManager.updateRoomSubject(this);
            // Notify all the occupants that the subject has changed
            packet.setFrom(actor.getOccupantJID());
            send(packet, actor);

            // Fire event signifying that the room's subject has changed.
            MUCEventDispatcher.roomSubjectChanged(getJID(), actor.getUserAddress(), subject);
        }
        else {
            throw new ForbiddenException();
        }
    }
Changes the room's subject if the occupant has enough permissions. The occupant must be
a moderator or the room must be configured so that anyone can change its subject, otherwise
a forbidden exception will be thrown.

The new subject will be added to the history of the room.

@param packet the stanza used to change the room's subject (cannot be {@code null}).
@param actor the occupant that is trying to change the subject (cannot be {@code null}).
@throws ForbiddenException If the user is not allowed to change the subject.
xmppserver/src/main/java/org/jivesoftware/openfire/muc/MUCRoom.java