From c5ee5419063dcab68a8a96a489c5655f62de52eb Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 18 Dec 2017 13:19:11 +0100 Subject: [PATCH] clear muc avatar after going online --- src/main/java/eu/siacs/conversations/entities/MucOptions.java | 4 +++- .../java/eu/siacs/conversations/parser/PresenceParser.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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); }