Malformed iq result when retrieving items from a pubsub node

Items appear twice. Also even items appear with an empty body and without the item tag

hola hola

Known issue that is already logged under issue OF-06.

About the first issue “Items appear twice”, the following patch to Openfire’s LeafNode.java would be helpful:

void sendPublishedItems(IQ originalRequest, List publishedItems,
boolean forceToIncludePayload) {
IQ result = IQ.createResultIQ(originalRequest);
Element childElement = originalRequest.getChildElement().createCopy();
result.setChildElement(childElement);
Element items = childElement.element(“items”);
items.clearContent(); // clear all sub-trees of
for (PublishedItem publishedItem : publishedItems) {

About the second issue “even items appear with an empty body and without the item tag”, it is very strange.

In Smack Debug Window, the “All Packets” tab reveals the mentioned issue;

but the “Raw Received Packets” tab shows correct IQ stanza.

In Psi, the “XML Console” also shows correct IQ stanza.

Perhaps the second issue is due to Smack, not Openfire?

This item (OF-6) has now been fixed.