aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-11-28 15:51:11 +0100
committerDaniel Gultsch <daniel@gultsch.de>2016-11-28 15:51:11 +0100
commite5d7357e6ea8f74634731a460b207334b21820c5 (patch)
tree3643d4b2507ceabff0ef0596ba4050110e9b4ac3 /src/main
parent84a2fa0041c6d30658ba29b3b5f5db2604c35c90 (diff)
mark conversations as read after receiving blocklist push for that conversations
Diffstat (limited to '')
-rw-r--r--src/main/java/eu/siacs/conversations/parser/IqParser.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/IqParser.java b/src/main/java/eu/siacs/conversations/parser/IqParser.java
index 49b0db21..40eec0d2 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);