diff --git a/src/main/java/eu/siacs/conversations/entities/MucOptions.java b/src/main/java/eu/siacs/conversations/entities/MucOptions.java index a708a009b..4a33883a6 100644 --- a/src/main/java/eu/siacs/conversations/entities/MucOptions.java +++ b/src/main/java/eu/siacs/conversations/entities/MucOptions.java @@ -553,8 +553,10 @@ public class MucOptions { this.error = error; } - public void setOnline() { + public boolean setOnline() { + boolean before = this.isOnline; this.isOnline = true; + return !before; } public ArrayList getUsers() { diff --git a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java index 0ed6ca6ad..a4fb6db3f 100644 --- a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java +++ b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java @@ -70,7 +70,9 @@ public class PresenceParser extends AbstractParser implements MucOptions.User user = parseItem(conversation, item, from); if (codes.contains(MucOptions.STATUS_CODE_SELF_PRESENCE) || ((codes.isEmpty() || codes.contains(MucOptions.STATUS_CODE_ROOM_CREATED)) && jid.equals(item.getAttributeAsJid("jid")))) { - mucOptions.setOnline(); + if (mucOptions.setOnline()) { + mXmppConnectionService.getAvatarService().clear(mucOptions); + } mucOptions.setSelf(user); invokeRenameListener(mucOptions, true); }