mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-26 14:02:06 +01:00
Fixed registration packet parsing (SMACK-88)
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2109 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
ac2166a62f
commit
104e47cb3e
1 changed files with 14 additions and 7 deletions
|
@ -500,9 +500,12 @@ class PacketReader {
|
|||
else if (parser.getName().equals("password")) {
|
||||
registration.setPassword(parser.nextText());
|
||||
}
|
||||
else {
|
||||
// Else if any other element that's in the jabber:iq:register namespace,
|
||||
// attempt to parse it if it's in the form <name>value</name>.
|
||||
else if (parser.getNamespace().equals("jabber:iq:register")) {
|
||||
String name = parser.getName();
|
||||
String value = parser.nextText();
|
||||
if (parser.next() == XmlPullParser.TEXT) {
|
||||
String value = parser.getText();
|
||||
// Ignore instructions, but anything else should be added to the map.
|
||||
if (!name.equals("instructions")) {
|
||||
if (fields == null) {
|
||||
|
@ -510,6 +513,10 @@ class PacketReader {
|
|||
}
|
||||
fields.put(name, value);
|
||||
}
|
||||
else {
|
||||
registration.setInstructions(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (eventType == XmlPullParser.END_TAG) {
|
||||
|
|
Loading…
Reference in a new issue