mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-23 04:22: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:
parent
2271ca730e
commit
2b22cde400
1 changed files with 8 additions and 9 deletions
|
@ -68,7 +68,12 @@ class PacketReader {
|
|||
|
||||
listenerThread = new Thread() {
|
||||
public void run() {
|
||||
processListeners();
|
||||
try {
|
||||
processListeners();
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
};
|
||||
listenerThread.setName("Smack Listener Processor");
|
||||
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue