From 39f1867d88d28922bb1de9bf753d145dd3f4c8e4 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 30 Jun 2021 21:35:00 +0200 Subject: [PATCH] Label $NotJunk --- app/src/main/java/eu/faircode/email/Core.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index 9aa9da29ab..71e4febcb5 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -1268,6 +1268,13 @@ class Core { // Remove star if (unflag && imessage.isSet(Flags.Flag.FLAGGED) && flags.contains(Flags.Flag.FLAGGED)) imessage.setFlag(Flags.Flag.FLAGGED, false); + + // Mark not spam + if (EntityFolder.JUNK.equals(folder.type) + && ifolder.getPermanentFlags().contains(Flags.Flag.USER)) { + Flags notJunk = new Flags("$NotJunk"); + imessage.setFlags(notJunk, true); + } } // https://tools.ietf.org/html/rfc6851 @@ -3406,7 +3413,8 @@ class Core { if (!have && !EntityFolder.TRASH.equals(folder.type) && !EntityFolder.JUNK.equals(folder.type) && - message.blocklist != null && message.blocklist) { + message.blocklist != null && message.blocklist && + !Arrays.asList(message.keywords).contains("$NotJunk")) { boolean use_blocklist = prefs.getBoolean("use_blocklist", false); if (use_blocklist) { EntityLog.log(context, "Block list" +