private void broadcast(@Nonnull final Message message, @Nonnull final MUCOccupant sender)
    {
        if (!message.getFrom().asBareJID().equals(this.getJID())) {
            // At this point, the 'from' address of the to-be broadcast stanza can be expected to be the role-address
            // of the subject, or more broadly: it's bare JID representation should match that of the room. If that's not
            // the case then there's a bug in Openfire. Catch this here, as otherwise, privacy-sensitive data is leaked.
            // See: OF-2152
            throw new IllegalArgumentException("Broadcast message stanza's 'from' JID " + message.getFrom() + " does not match room JID: " + this.getJID());
        }

        // If FMUC is active, propagate the message through FMUC first. Note that when a master-slave mode is active,
        // we need to wait for an echo back, before the message can be broadcast locally. The 'propagate' method will
        // return a CompletableFuture object that is completed as soon as processing can continue.
        fmucHandler.propagate( message, sender )
            // DO NOT use 'thenRunAsync', as that will cause issues with clustering (it uses an executor that overrides the contextClassLoader, causing ClassNotFound exceptions in ClusterExternalizableUtil).
            .thenRun( () -> {
                    // Broadcast message to occupants connected to this domain.
                    broadcast(message);
                }
            );
    }
Creates a copy of the presence stanza encapsulated in the argument, that is suitable to be sent back to the
entity that is the subject of the presence update (a 'self-presence'). The returned stanza contains several
flags that indicate to the receiving client that the information relates to their user.

@param presence The object encapsulating the presence to be broadcast.
@param isJoinPresence If the presence is sent in the context of joining the room.
@return A copy of the stanza to be broadcast.
xmppserver/src/main/java/org/jivesoftware/openfire/muc/MUCRoom.java