private void addRemoteHistoryToRoom( @Nonnull final List<Message> messages )
    {
        final List<Message> parsedMessages = new LinkedList<>();
        for (final Message message : messages) {
            final Element fmuc = message.getElement().element(FMUC);
            if (fmuc == null) {
                throw new IllegalArgumentException("Argument 'presence' should be an FMUC presence, but it does not appear to be: it is missing the FMUC child element.");
            }

            Log.trace("(room: '{}'): Received history from joined FMUC node '{}'. Applying it locally.", room.getJID(), outboundJoinProgress.getPeer());

            final JID userJID = new JID(fmuc.attributeValue("from"));
            final String nickname = message.getFrom().getResource();
            Date sentDate;
            final Element delay = message.getChildElement("delay", "urn:xmpp:delay");
            if (delay != null) {
                final String stamp = delay.attributeValue("stamp");
                try {
                    sentDate = new XMPPDateTimeFormat().parseString(stamp);
                } catch (ParseException e) {
                    Log.warn("Cannot parse 'stamp' from delay element in message as received in FMUC join: {}", message, e);
                    sentDate = null;
                }
            } else {
                sentDate = null;
                Log.warn("Missing delay element in message received in FMUC join: {}", message);
            }

            final Message cleanedUpMessage = createCopyWithoutFMUC(message);
            final Message parsed = room.getRoomHistory().parseHistoricMessage(userJID.toString(), nickname, sentDate, cleanedUpMessage.getSubject(), cleanedUpMessage.getBody(), cleanedUpMessage.toXML());
            parsedMessages.add(parsed);
        }

        room.getRoomHistory().addOldMessages(parsedMessages);
    }
Processes a stanza that is received from another node in the FMUC set, by translating it into 'regular' MUC data.

The provided input is expected to be a stanza received from another node in the FMUC set. It is stripped from
FMUC data, after which it is distributed to the local users.

Additionally, it is sent out to all (other) FMUC nodes that are known.

@param stanza The data to be processed.
xmppserver/src/main/java/org/jivesoftware/openfire/muc/spi/FMUCHandler.java