mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-16 12:12:06 +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:
parent
25012a6744
commit
3146023dd4
2 changed files with 9 additions and 4 deletions
|
@ -61,6 +61,7 @@ public class ItemProvider implements PacketExtensionProvider
|
||||||
if (tag == XmlPullParser.END_TAG && parser.getName().equals(elem))
|
if (tag == XmlPullParser.END_TAG && parser.getName().equals(elem))
|
||||||
{
|
{
|
||||||
done = true;
|
done = true;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else if (parser.getEventType() == XmlPullParser.START_TAG)
|
else if (parser.getEventType() == XmlPullParser.START_TAG)
|
||||||
{
|
{
|
||||||
|
@ -87,9 +88,13 @@ public class ItemProvider implements PacketExtensionProvider
|
||||||
else if (parser.getEventType() == XmlPullParser.END_TAG)
|
else if (parser.getEventType() == XmlPullParser.END_TAG)
|
||||||
{
|
{
|
||||||
if (isEmptyElement)
|
if (isEmptyElement)
|
||||||
|
{
|
||||||
isEmptyElement = false;
|
isEmptyElement = false;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
payloadText.append("</").append(parser.getName()).append(">");
|
payloadText.append("</").append(parser.getName()).append(">");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (parser.getEventType() == XmlPullParser.TEXT)
|
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()));
|
return new PayloadItem<SimplePayload>(id, node, new SimplePayload(payloadElemName, payloadNS, payloadText.toString()));
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
return new PayloadItem<PacketExtension>(id, node, PacketParserUtils.parsePacketExtension(
|
{
|
||||||
payloadElemName, payloadNS, parser));
|
return new PayloadItem<PacketExtension>(id, node, PacketParserUtils.parsePacketExtension(payloadElemName, payloadNS, parser));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.PacketExtension;
|
import org.jivesoftware.smack.packet.PacketExtension;
|
||||||
import org.jivesoftware.smackx.provider.EmbeddedExtensionProvider;
|
import org.jivesoftware.smack.provider.EmbeddedExtensionProvider;
|
||||||
import org.jivesoftware.smackx.pubsub.ItemsExtension;
|
import org.jivesoftware.smackx.pubsub.ItemsExtension;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue