mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-26 05:52:06 +01:00
Wait in Roster's presence listener until Roster is loaded
Fixes SMACK-681.
This commit is contained in:
parent
e6a403fb1c
commit
3bb06b8429
1 changed files with 7 additions and 0 deletions
|
@ -1180,6 +1180,13 @@ public class Roster extends Manager {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processPacket(Stanza packet) throws NotConnectedException {
|
public void processPacket(Stanza packet) throws NotConnectedException {
|
||||||
|
// Try to ensure that the roster is loaded when processing presence stanzas. While the
|
||||||
|
// presence listener is synchronous, the roster result listener is not, which means that
|
||||||
|
// the presence listener may be invoked with a not yet loaded roster.
|
||||||
|
boolean loaded = waitUntilLoaded();
|
||||||
|
if (loaded) {
|
||||||
|
LOGGER.warning("Roster not loaded while processing presence stanza");
|
||||||
|
}
|
||||||
final XMPPConnection connection = connection();
|
final XMPPConnection connection = connection();
|
||||||
Presence presence = (Presence) packet;
|
Presence presence = (Presence) packet;
|
||||||
String from = presence.getFrom();
|
String from = presence.getFrom();
|
||||||
|
|
Loading…
Reference in a new issue