mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 23:12:55 +00:00
Auto block spam
This commit is contained in:
parent
89a632a51b
commit
bfaad8333e
2 changed files with 12 additions and 1 deletions
|
@ -181,6 +181,7 @@ public class EntityOperation {
|
||||||
// 0: target folder
|
// 0: target folder
|
||||||
// 1: mark seen
|
// 1: mark seen
|
||||||
// 2: auto classified
|
// 2: auto classified
|
||||||
|
// 3: no block sender
|
||||||
|
|
||||||
// Parameters out:
|
// Parameters out:
|
||||||
// 0: target folder
|
// 0: target folder
|
||||||
|
@ -211,6 +212,16 @@ public class EntityOperation {
|
||||||
if (source == null || target == null || source.id.equals(target.id))
|
if (source == null || target == null || source.id.equals(target.id))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (EntityFolder.JUNK.equals(target.type) &&
|
||||||
|
Objects.equals(source.account, target.account) &&
|
||||||
|
(jargs.opt(3) == null || !jargs.optBoolean(3))) {
|
||||||
|
jargs.remove(3);
|
||||||
|
EntityLog.log(context, "Auto block sender=" + MessageHelper.formatAddresses(message.from));
|
||||||
|
EntityContact.update(context,
|
||||||
|
message.account, message.identity, message.from,
|
||||||
|
EntityContact.TYPE_JUNK, message.received);
|
||||||
|
}
|
||||||
|
|
||||||
if (EntityFolder.DRAFTS.equals(source.type) &&
|
if (EntityFolder.DRAFTS.equals(source.type) &&
|
||||||
EntityFolder.TRASH.equals(target.type))
|
EntityFolder.TRASH.equals(target.type))
|
||||||
autoread = true;
|
autoread = true;
|
||||||
|
|
|
@ -8838,7 +8838,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||||
throw new IllegalArgumentException(context.getString(R.string.title_no_junk_folder));
|
throw new IllegalArgumentException(context.getString(R.string.title_no_junk_folder));
|
||||||
|
|
||||||
if (!message.folder.equals(junk.id))
|
if (!message.folder.equals(junk.id))
|
||||||
EntityOperation.queue(context, message, EntityOperation.MOVE, junk.id);
|
EntityOperation.queue(context, message, EntityOperation.MOVE, junk.id, null, null, true);
|
||||||
|
|
||||||
if (block_domain) {
|
if (block_domain) {
|
||||||
List<EntityRule> rules = EntityRule.blockSender(context, message, junk, block_domain);
|
List<EntityRule> rules = EntityRule.blockSender(context, message, junk, block_domain);
|
||||||
|
|
Loading…
Reference in a new issue