aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-11-29 21:41:03 +0100
committerChristian Schneppe <christian@pix-art.de>2016-11-29 21:41:03 +0100
commit489ea5d38e68133c4d7acd106cb869ac3701c6d4 (patch)
tree46a54648a9ce547b84b83de55cdb4b899321fc29 /src
parentbdda426ad4223773b5873ee20db22a22dff0e49b (diff)
mark conversations as read after receiving blocklist push for that conversation
Diffstat (limited to 'src')
-rw-r--r--src/main/java/de/pixart/messenger/parser/IqParser.java9
1 files changed, 9 insertions, 0 deletions
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);