1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-26 08:12:05 +01:00

SMACK-455 Fixed improper advance of parser when parsing multiple items in a pubsub message.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_3_1@13760 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
rcollier 2013-10-07 01:38:09 +00:00
parent 25012a6744
commit 3146023dd4
2 changed files with 9 additions and 4 deletions

View file

@ -61,6 +61,7 @@ public class ItemProvider implements PacketExtensionProvider
if (tag == XmlPullParser.END_TAG && parser.getName().equals(elem))
{
done = true;
continue;
}
else if (parser.getEventType() == XmlPullParser.START_TAG)
{
@ -87,9 +88,13 @@ public class ItemProvider implements PacketExtensionProvider
else if (parser.getEventType() == XmlPullParser.END_TAG)
{
if (isEmptyElement)
{
isEmptyElement = false;
}
else
{
payloadText.append("</").append(parser.getName()).append(">");
}
}
else if (parser.getEventType() == XmlPullParser.TEXT)
{
@ -99,9 +104,9 @@ public class ItemProvider implements PacketExtensionProvider
}
return new PayloadItem<SimplePayload>(id, node, new SimplePayload(payloadElemName, payloadNS, payloadText.toString()));
}
else {
return new PayloadItem<PacketExtension>(id, node, PacketParserUtils.parsePacketExtension(
payloadElemName, payloadNS, parser));
else
{
return new PayloadItem<PacketExtension>(id, node, PacketParserUtils.parsePacketExtension(payloadElemName, payloadNS, parser));
}
}
}

View file

@ -17,7 +17,7 @@ import java.util.List;
import java.util.Map;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smackx.provider.EmbeddedExtensionProvider;
import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
import org.jivesoftware.smackx.pubsub.ItemsExtension;
/**