mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-26 05:52: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,12 +745,19 @@ class PacketReader {
|
|||
int eventType = parser.next();
|
||||
if (eventType == XmlPullParser.START_TAG) {
|
||||
String name = parser.getName();
|
||||
parser.next();
|
||||
// If an empty element, set the value with the empty string.
|
||||
if (parser.isEmptyElementTag()) {
|
||||
extension.setValue(name,"");
|
||||
}
|
||||
// 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) {
|
||||
if (parser.getName().equals(elementName)) {
|
||||
done = true;
|
||||
|
|
Loading…
Reference in a new issue