Skip to content

Commit

Permalink
[roster] suppress "roster not loaded while processing presence" if se…
Browse files Browse the repository at this point in the history
…lf-presence

Fixes SMACK-941.
  • Loading branch information
Flowdalic committed Feb 9, 2024
1 parent 8b9a9e0 commit f6b2218
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java
Original file line number Diff line number Diff line change
Expand Up @@ -1534,11 +1534,20 @@ public void processStanza(Stanza packet) throws NotConnectedException, Interrupt

}
}

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.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) {
Expand Down

0 comments on commit f6b2218

Please sign in to comment.