diff --git a/source/org/jivesoftware/smack/XMPPConnection.java b/source/org/jivesoftware/smack/XMPPConnection.java index 3d9e4452d..7c14b0aae 100644 --- a/source/org/jivesoftware/smack/XMPPConnection.java +++ b/source/org/jivesoftware/smack/XMPPConnection.java @@ -309,13 +309,14 @@ public class XMPPConnection { } // We're done with the collector, so explicitly cancel it. collector.cancel(); - // Set presence to online. - packetWriter.sendPacket(new Presence(Presence.Type.AVAILABLE)); - // Finally, create the roster. + // Create the roster. this.roster = new Roster(this); roster.reload(); + // Set presence to online. + packetWriter.sendPacket(new Presence(Presence.Type.AVAILABLE)); + // Indicate that we're now authenticated. authenticated = true;