1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-10-18 12:15:58 +02:00

Merge pull request #577 from Flowdalic/supress-roster-not-loaded-warning

Supress roster not loaded warning if self-presence
This commit is contained in:
Florian Schmaus 2024-04-02 15:23:35 +02:00 committed by GitHub
commit 505e1088b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1534,11 +1534,20 @@ public final class Roster extends Manager {
}
}
final Jid from = packet.getFrom();
if (!isLoaded() && rosterLoadedAtLogin) {
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) {