@Override
    public Set<DataForm> getExtendedInfos(String name, String node, JID senderJID) {
        // Mark that offline messages shouldn't be sent when the user becomes available
        stopOfflineFlooding(senderJID);

        final DataForm dataForm = new DataForm(DataForm.Type.result);

        final FormField field1 = dataForm.addField();
        field1.setVariable("FORM_TYPE");
        field1.setType(FormField.Type.hidden);
        field1.addValue(NAMESPACE);

        final FormField field2 = dataForm.addField();
        field2.setVariable("number_of_messages");
        field2.addValue(String.valueOf(messageStore.getCount(senderJID.getNode())));
        
        final Set<DataForm> dataForms = new HashSet<>();
        dataForms.add(dataForm);
        return dataForms;
    }
Implements JEP-0013: Flexible Offline Message Retrieval. Allows users to request number of
messages, request message headers, retrieve specific messages, remove specific messages,
retrieve all messages and remove all messages.

@author Gaston Dombiak
xmppserver/src/main/java/org/jivesoftware/openfire/handler/IQOfflineMessagesHandler.java