mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-28 20:06:29 +01:00
Auto block spam
This commit is contained in:
@@ -181,6 +181,7 @@ public class EntityOperation {
|
||||
// 0: target folder
|
||||
// 1: mark seen
|
||||
// 2: auto classified
|
||||
// 3: no block sender
|
||||
|
||||
// Parameters out:
|
||||
// 0: target folder
|
||||
@@ -211,6 +212,16 @@ public class EntityOperation {
|
||||
if (source == null || target == null || source.id.equals(target.id))
|
||||
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) &&
|
||||
EntityFolder.TRASH.equals(target.type))
|
||||
autoread = true;
|
||||
|
||||
@@ -8838,7 +8838,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
||||
throw new IllegalArgumentException(context.getString(R.string.title_no_junk_folder));
|
||||
|
||||
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) {
|
||||
List<EntityRule> rules = EntityRule.blockSender(context, message, junk, block_domain);
|
||||
|
||||
Reference in New Issue
Block a user