1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-24 11:38:00 +01:00

[roster] suppress "roster not loaded while processing presence" if self-presence

Fixes SMACK-941.
This commit is contained in:
Florian Schmaus 2024-02-09 14:13:36 +01:00
parent 8b9a9e0f3e
commit 6918663760

View file

@ -1534,11 +1534,20 @@ public final class Roster extends Manager {
}
}
final Jid from = packet.getFrom();
if (!isLoaded() && rosterLoadedAtLogin) {
LOGGER.warning("Roster not loaded while processing " + packet);
XMPPConnection connection = connection();
// Only log the warning, if this is not the reflected self-presence. Otherwise,
// the reflected self-presence may cause a spurious warning in case the
// connection got quickly shut down. See SMACK-941.
if (connection != null && from != null && !from.equals(connection.getUser())) {
LOGGER.warning("Roster not loaded while processing " + packet);
}
}
final Presence presence = (Presence) packet;
final Jid from = presence.getFrom();
final BareJid key;
if (from != null) {