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

Fixes for default packet extension parsing.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@1982 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Matt Tucker 2003-07-03 22:14:31 +00:00 committed by mtucker
parent 6ed772e660
commit ed14b2a204

View file

@ -745,10 +745,17 @@ class PacketReader {
int eventType = parser.next(); int eventType = parser.next();
if (eventType == XmlPullParser.START_TAG) { if (eventType == XmlPullParser.START_TAG) {
String name = parser.getName(); String name = parser.getName();
parser.next(); // If an empty element, set the value with the empty string.
if (eventType == XmlPullParser.TEXT) { if (parser.isEmptyElementTag()) {
String value = parser.getText(); extension.setValue(name,"");
extension.setValue(name, value); }
// Otherwise, get the the element text.
else {
eventType = parser.next();
if (eventType == XmlPullParser.TEXT) {
String value = parser.getText();
extension.setValue(name, value);
}
} }
} }
else if (eventType == XmlPullParser.END_TAG) { else if (eventType == XmlPullParser.END_TAG) {