diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-12-27 21:02:49 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-12-27 21:02:49 +0100 |
commit | 678344b165760bf174872721428748a608beea96 (patch) | |
tree | 8e5a2d33b5337766370a5d0339257d4d89528ce6 /src/main/java | |
parent | e7243b5e2ce38408faa47bf804d867295f100d61 (diff) |
clear muc avatar after going online
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/de/pixart/messenger/entities/MucOptions.java | 4 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/parser/PresenceParser.java | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/MucOptions.java b/src/main/java/de/pixart/messenger/entities/MucOptions.java index c6e0b6dc2..eecdcb2f0 100644 --- a/src/main/java/de/pixart/messenger/entities/MucOptions.java +++ b/src/main/java/de/pixart/messenger/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<User> getUsers() { diff --git a/src/main/java/de/pixart/messenger/parser/PresenceParser.java b/src/main/java/de/pixart/messenger/parser/PresenceParser.java index f020c314a..e50c1f3a7 100644 --- a/src/main/java/de/pixart/messenger/parser/PresenceParser.java +++ b/src/main/java/de/pixart/messenger/parser/PresenceParser.java @@ -68,7 +68,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); } |