From 6ee27090ce08afa1f4d8cdf996e28503db5ec214 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 16 Nov 2022 09:23:38 +0100 Subject: [PATCH] Skip self on auto block sender --- app/src/main/java/eu/faircode/email/EntityOperation.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/EntityOperation.java b/app/src/main/java/eu/faircode/email/EntityOperation.java index e755a135bc..c8a4ea14ff 100644 --- a/app/src/main/java/eu/faircode/email/EntityOperation.java +++ b/app/src/main/java/eu/faircode/email/EntityOperation.java @@ -233,9 +233,12 @@ public class EntityOperation { (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); + + List identities = db.identity().getComposableIdentities(null); + if (!message.fromSelf(identities)) + EntityContact.update(context, + message.account, message.identity, message.from, + EntityContact.TYPE_JUNK, message.received); } if (EntityFolder.DRAFTS.equals(source.type) &&