aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-11-20 22:44:31 +0100
committeriNPUTmice <daniel@gultsch.de>2014-11-20 22:44:31 +0100
commit92ad4cb73650b95f0888afabe60f179d282e4e06 (patch)
treebfb5c431f65989e97855a6409ee4b8733284545a /src/main/java/eu/siacs
parent66abdfccd4f7e3117bc60434657bc005434ee3b4 (diff)
changed listener timing and cache clearing after muc presences
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r--src/main/java/eu/siacs/conversations/parser/PresenceParser.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java
index 635f29327..8b3679707 100644
--- a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java
+++ b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java
@@ -4,6 +4,7 @@ import eu.siacs.conversations.crypto.PgpEngine;
import eu.siacs.conversations.entities.Account;
import eu.siacs.conversations.entities.Contact;
import eu.siacs.conversations.entities.Conversation;
+import eu.siacs.conversations.entities.MucOptions;
import eu.siacs.conversations.entities.Presences;
import eu.siacs.conversations.generator.PresenceGenerator;
import eu.siacs.conversations.services.XmppConnectionService;
@@ -34,15 +35,17 @@ public class PresenceParser extends AbstractParser implements
mXmppConnectionService.getAvatarService().clear(muc);
}
} else if (packet.hasChild("x", "http://jabber.org/protocol/muc")) {
- final Conversation muc = mXmppConnectionService.find(account,
+ final Conversation conversation = mXmppConnectionService.find(account,
packet.getFrom().toBareJid());
- if (muc != null) {
- boolean before = muc.getMucOptions().online();
- muc.getMucOptions().processPacket(packet, mPgpEngine);
- if (before != muc.getMucOptions().online()) {
+ if (conversation != null) {
+ final MucOptions mucOptions = conversation.getMucOptions();
+ boolean before = mucOptions.online();
+ int count = mucOptions.getUsers().size();
+ mucOptions.processPacket(packet, mPgpEngine);
+ mXmppConnectionService.getAvatarService().clear(conversation);
+ if (before != mucOptions.online() || (mucOptions.online() && count != mucOptions.getUsers().size())) {
mXmppConnectionService.updateConversationUi();
}
- mXmppConnectionService.getAvatarService().clear(muc);
}
}
}