only notify ui on significant muc changes

This commit is contained in:
iNPUTmice 2014-08-13 11:21:33 +02:00
parent 07e6873025
commit a4faa158c0
1 changed files with 8 additions and 1 deletions

View File

@ -24,16 +24,23 @@ public class PresenceParser extends AbstractParser implements
Conversation muc = mXmppConnectionService.find(account, packet Conversation muc = mXmppConnectionService.find(account, packet
.getAttribute("from").split("/")[0]); .getAttribute("from").split("/")[0]);
if (muc != null) { if (muc != null) {
boolean before = muc.getMucOptions().online();
muc.getMucOptions().processPacket(packet, mPgpEngine); muc.getMucOptions().processPacket(packet, mPgpEngine);
if (before!=muc.getMucOptions().online()) {
mXmppConnectionService.updateConversationUi();
}
} }
} else if (packet.hasChild("x", "http://jabber.org/protocol/muc")) { } else if (packet.hasChild("x", "http://jabber.org/protocol/muc")) {
Conversation muc = mXmppConnectionService.find(account, packet Conversation muc = mXmppConnectionService.find(account, packet
.getAttribute("from").split("/")[0]); .getAttribute("from").split("/")[0]);
if (muc != null) { if (muc != null) {
boolean before = muc.getMucOptions().online();
muc.getMucOptions().processPacket(packet, mPgpEngine); muc.getMucOptions().processPacket(packet, mPgpEngine);
if (before!=muc.getMucOptions().online()) {
mXmppConnectionService.updateConversationUi();
}
} }
} }
mXmppConnectionService.updateConversationUi();
} }
public void parseContactPresence(PresencePacket packet, Account account) { public void parseContactPresence(PresencePacket packet, Account account) {