clear muc avatar after going online

This commit is contained in:
Daniel Gultsch 2017-12-18 13:19:11 +01:00
parent e0ec6ad8b6
commit c5ee541906
2 changed files with 6 additions and 2 deletions

View file

@ -553,8 +553,10 @@ public class MucOptions {
this.error = error; this.error = error;
} }
public void setOnline() { public boolean setOnline() {
boolean before = this.isOnline;
this.isOnline = true; this.isOnline = true;
return !before;
} }
public ArrayList<User> getUsers() { public ArrayList<User> getUsers() {

View file

@ -70,7 +70,9 @@ public class PresenceParser extends AbstractParser implements
MucOptions.User user = parseItem(conversation, item, from); MucOptions.User user = parseItem(conversation, item, from);
if (codes.contains(MucOptions.STATUS_CODE_SELF_PRESENCE) if (codes.contains(MucOptions.STATUS_CODE_SELF_PRESENCE)
|| ((codes.isEmpty() || codes.contains(MucOptions.STATUS_CODE_ROOM_CREATED)) && jid.equals(item.getAttributeAsJid("jid")))) { || ((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); mucOptions.setSelf(user);
invokeRenameListener(mucOptions, true); invokeRenameListener(mucOptions, true);
} }