From 9f687f7f1cbdd972f6a85a84506033dc44fa0d67 Mon Sep 17 00:00:00 2001 From: Matt Tucker Date: Wed, 20 Aug 2003 20:31:47 +0000 Subject: [PATCH] Fix for class cast exception git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2052 b35dd754-fafc-0310-a699-88a17e54d16e --- source/org/jivesoftware/smack/XMPPConnection.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/source/org/jivesoftware/smack/XMPPConnection.java b/source/org/jivesoftware/smack/XMPPConnection.java index 19009a63d..9586056c0 100644 --- a/source/org/jivesoftware/smack/XMPPConnection.java +++ b/source/org/jivesoftware/smack/XMPPConnection.java @@ -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.