From 4fddb571f10bccfe6720d3a00ed170be8d227bd1 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 21 Mar 2023 12:03:16 +0100 Subject: [PATCH] Small fix --- app/src/main/java/eu/faircode/email/EntityContact.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/EntityContact.java b/app/src/main/java/eu/faircode/email/EntityContact.java index 6263147208..5a96a78e07 100644 --- a/app/src/main/java/eu/faircode/email/EntityContact.java +++ b/app/src/main/java/eu/faircode/email/EntityContact.java @@ -98,6 +98,8 @@ public class EntityContact implements Serializable { @NonNull public Integer state = STATE_DEFAULT; + private static int MAX_AGE = EntityFolder.DEFAULT_KEEP; + static void received( @NonNull Context context, @NonNull EntityAccount account, @@ -105,8 +107,8 @@ public class EntityContact implements Serializable { @NonNull EntityMessage message) { if (account.protocol == EntityAccount.TYPE_IMAP) { int days = (folder.isOutgoing() ? folder.keep_days : folder.sync_days); - if (days == Integer.MAX_VALUE) - days = EntityFolder.DEFAULT_KEEP; + if (days > MAX_AGE) + days = MAX_AGE; if (message.received < account.created - days * 24 * 3600 * 1000L) return; }