mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 22:32: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:
parent
6ed772e660
commit
ed14b2a204
1 changed files with 11 additions and 4 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue