1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-30 02:02:06 +01:00

Setup Roster before sending initial presence

Thanks to Phil Winder for reporting the issue.
This commit is contained in:
Florian Schmaus 2014-10-20 21:58:20 +02:00
parent 47e327f2e6
commit 5ad4e85ed5

View file

@ -453,6 +453,11 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
// eventually load the roster. And we should load the roster before we // eventually load the roster. And we should load the roster before we
// send the initial presence. // send the initial presence.
if (config.isSendPresence() && !resumed) { if (config.isSendPresence() && !resumed) {
if (!isAnonymous()) {
// Make sure that the roster has setup its listeners prior sending the initial presence by calling
// getRoster()
getRoster();
}
sendPacket(new Presence(Presence.Type.available)); sendPacket(new Presence(Presence.Type.available));
} }
} }