From e5d7357e6ea8f74634731a460b207334b21820c5 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 28 Nov 2016 15:51:11 +0100 Subject: [PATCH] mark conversations as read after receiving blocklist push for that conversations --- .../java/eu/siacs/conversations/parser/IqParser.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/parser/IqParser.java b/src/main/java/eu/siacs/conversations/parser/IqParser.java index 49b0db216..40eec0d2c 100644 --- a/src/main/java/eu/siacs/conversations/parser/IqParser.java +++ b/src/main/java/eu/siacs/conversations/parser/IqParser.java @@ -26,6 +26,7 @@ import eu.siacs.conversations.Config; import eu.siacs.conversations.crypto.axolotl.AxolotlService; import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Contact; +import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.services.XmppConnectionService; import eu.siacs.conversations.utils.Xmlns; import eu.siacs.conversations.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);