1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-26 22:12:05 +01:00

1. Username and password are optional in Registration. SMACK-62

2. Added try/catch block when invoking packet listeners.


git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2504 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Gaston Dombiak 2005-06-17 22:29:33 +00:00 committed by gaston
parent 2271ca730e
commit 2b22cde400

View file

@ -68,8 +68,13 @@ class PacketReader {
listenerThread = new Thread() {
public void run() {
try {
processListeners();
}
catch (Exception e) {
e.printStackTrace();
}
}
};
listenerThread.setName("Smack Listener Processor");
listenerThread.setDaemon(true);
@ -499,15 +504,9 @@ class PacketReader {
while (!done) {
int eventType = parser.next();
if (eventType == XmlPullParser.START_TAG) {
if (parser.getName().equals("username")) {
registration.setUsername(parser.nextText());
}
else if (parser.getName().equals("password")) {
registration.setPassword(parser.nextText());
}
// Else if any other element that's in the jabber:iq:register namespace,
// Any 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")) {
if (parser.getNamespace().equals("jabber:iq:register")) {
String name = parser.getName();
String value = "";
if (fields == null) {