From a4faa158c0c8f92f9f430c8daa931f16b4f2a58d Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Wed, 13 Aug 2014 11:21:33 +0200 Subject: [PATCH] only notify ui on significant muc changes --- src/eu/siacs/conversations/parser/PresenceParser.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/eu/siacs/conversations/parser/PresenceParser.java b/src/eu/siacs/conversations/parser/PresenceParser.java index 3582653fa..ea19df6f7 100644 --- a/src/eu/siacs/conversations/parser/PresenceParser.java +++ b/src/eu/siacs/conversations/parser/PresenceParser.java @@ -24,16 +24,23 @@ public class PresenceParser extends AbstractParser implements Conversation muc = mXmppConnectionService.find(account, packet .getAttribute("from").split("/")[0]); if (muc != null) { + boolean before = muc.getMucOptions().online(); muc.getMucOptions().processPacket(packet, mPgpEngine); + if (before!=muc.getMucOptions().online()) { + mXmppConnectionService.updateConversationUi(); + } } } else if (packet.hasChild("x", "http://jabber.org/protocol/muc")) { Conversation muc = mXmppConnectionService.find(account, packet .getAttribute("from").split("/")[0]); if (muc != null) { + boolean before = muc.getMucOptions().online(); muc.getMucOptions().processPacket(packet, mPgpEngine); + if (before!=muc.getMucOptions().online()) { + mXmppConnectionService.updateConversationUi(); + } } } - mXmppConnectionService.updateConversationUi(); } public void parseContactPresence(PresencePacket packet, Account account) {