From 489ea5d38e68133c4d7acd106cb869ac3701c6d4 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Tue, 29 Nov 2016 21:41:03 +0100 Subject: mark conversations as read after receiving blocklist push for that conversation --- src/main/java/de/pixart/messenger/parser/IqParser.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/main') diff --git a/src/main/java/de/pixart/messenger/parser/IqParser.java b/src/main/java/de/pixart/messenger/parser/IqParser.java index 25d946c1d..2e52d8707 100644 --- a/src/main/java/de/pixart/messenger/parser/IqParser.java +++ b/src/main/java/de/pixart/messenger/parser/IqParser.java @@ -26,6 +26,7 @@ import de.pixart.messenger.Config; import de.pixart.messenger.crypto.axolotl.AxolotlService; import de.pixart.messenger.entities.Account; import de.pixart.messenger.entities.Contact; +import de.pixart.messenger.entities.Conversation; import de.pixart.messenger.services.XmppConnectionService; import de.pixart.messenger.utils.Xmlns; import de.pixart.messenger.xml.Element; @@ -319,6 +320,14 @@ public class IqParser extends AbstractParser implements OnIqPacketReceived { } } account.getBlocklist().addAll(jids); + if (packet.getType() == IqPacket.TYPE.SET) { + for(Jid jid : jids) { + Conversation conversation = mXmppConnectionService.find(account,jid); + if (conversation != null) { + mXmppConnectionService.markRead(conversation); + } + } + } } // Update the UI mXmppConnectionService.updateBlocklistUi(OnUpdateBlocklist.Status.BLOCKED); -- cgit v1.2.3