mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-11 11:45:01 -05:00
clear muc tiles cache only when necessary
This commit is contained in:
parent
7ee5e95959
commit
3db5a48529
@ -150,6 +150,21 @@ public class MucOptions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object other) {
|
||||||
|
if (this == other) {
|
||||||
|
return true;
|
||||||
|
} else if (!(other instanceof User)) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
User o = (User) other;
|
||||||
|
return name != null && name.equals(o.name)
|
||||||
|
&& jid != null && jid.equals(o.jid)
|
||||||
|
&& affiliation == o.affiliation
|
||||||
|
&& role == o.role;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Affiliation getAffiliation() {
|
public Affiliation getAffiliation() {
|
||||||
return this.affiliation;
|
return this.affiliation;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package eu.siacs.conversations.parser;
|
package eu.siacs.conversations.parser;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import eu.siacs.conversations.crypto.PgpEngine;
|
import eu.siacs.conversations.crypto.PgpEngine;
|
||||||
import eu.siacs.conversations.entities.Account;
|
import eu.siacs.conversations.entities.Account;
|
||||||
import eu.siacs.conversations.entities.Contact;
|
import eu.siacs.conversations.entities.Contact;
|
||||||
@ -27,8 +29,12 @@ public class PresenceParser extends AbstractParser implements
|
|||||||
final MucOptions mucOptions = conversation.getMucOptions();
|
final MucOptions mucOptions = conversation.getMucOptions();
|
||||||
boolean before = mucOptions.online();
|
boolean before = mucOptions.online();
|
||||||
int count = mucOptions.getUsers().size();
|
int count = mucOptions.getUsers().size();
|
||||||
|
final ArrayList<MucOptions.User> tileUserBefore = new ArrayList<>(mucOptions.getUsers().subList(0,Math.min(mucOptions.getUsers().size(),4)));
|
||||||
mucOptions.processPacket(packet, mPgpEngine);
|
mucOptions.processPacket(packet, mPgpEngine);
|
||||||
|
final ArrayList<MucOptions.User> tileUserAfter = new ArrayList<>(mucOptions.getUsers().subList(0,Math.min(mucOptions.getUsers().size(),4)));
|
||||||
|
if (!tileUserAfter.equals(tileUserBefore)) {
|
||||||
mXmppConnectionService.getAvatarService().clear(conversation);
|
mXmppConnectionService.getAvatarService().clear(conversation);
|
||||||
|
}
|
||||||
if (before != mucOptions.online() || (mucOptions.online() && count != mucOptions.getUsers().size())) {
|
if (before != mucOptions.online() || (mucOptions.online() && count != mucOptions.getUsers().size())) {
|
||||||
mXmppConnectionService.updateConversationUi();
|
mXmppConnectionService.updateConversationUi();
|
||||||
} else if (mucOptions.online()) {
|
} else if (mucOptions.online()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user