1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-23 13:07:59 +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:
Matt Tucker 2003-09-27 17:27:40 +00:00 committed by mtucker
parent ac2166a62f
commit 104e47cb3e

View file

@ -500,15 +500,22 @@ class PacketReader {
else if (parser.getName().equals("password")) { else if (parser.getName().equals("password")) {
registration.setPassword(parser.nextText()); 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 name = parser.getName();
String value = parser.nextText(); if (parser.next() == XmlPullParser.TEXT) {
// Ignore instructions, but anything else should be added to the map. String value = parser.getText();
if (!name.equals("instructions")) { // Ignore instructions, but anything else should be added to the map.
if (fields == null) { if (!name.equals("instructions")) {
fields = new HashMap(); if (fields == null) {
fields = new HashMap();
}
fields.put(name, value);
}
else {
registration.setInstructions(value);
} }
fields.put(name, value);
} }
} }
} }