Fix for class cast exception

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2052 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Matt Tucker 2003-08-20 20:31:47 +00:00 committed by mtucker
parent e805172f46
commit 9f687f7f1c
1 changed files with 4 additions and 6 deletions

View File

@ -296,8 +296,7 @@ public class XMPPConnection {
auth.setResource(resource);
collector = packetReader.createPacketCollector(
new PacketIDFilter(auth.getPacketID()));
collector = packetReader.createPacketCollector(new PacketIDFilter(auth.getPacketID()));
// Send the packet.
packetWriter.sendPacket(auth);
// Wait up to five seconds for a response from the server.
@ -313,10 +312,9 @@ public class XMPPConnection {
this.user = response.getTo();
}
else {
Authentication authResponse = (Authentication)response;
this.user = authResponse.getUsername() + "@" + this.host;
if (authResponse.getResource() != null) {
this.user += "/" + authResponse.getResource();
this.user = username + "@" + this.host;
if (resource != null) {
this.user += "/" + resource;
}
}
// We're done with the collector, so explicitly cancel it.