Skip to content

Commit

Permalink
Merge pull request igniterealtime#577 from Flowdalic/supress-roster-n…
Browse files Browse the repository at this point in the history
…ot-loaded-warning

Supress roster not loaded warning if self-presence
  • Loading branch information
Flowdalic authored Apr 2, 2024
2 parents 435e736 + 6918663 commit 505e108
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 != 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 505e108

Please sign in to comment.