From 34884e7e858127d7a03f1a67fb78a437d7106b27 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 1 Oct 2018 13:05:14 +0000 Subject: [PATCH] Auto download attachments on unmetered connection --- app/src/main/java/eu/faircode/email/ServiceSynchronize.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 5fd6f407..7a56c0ac 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -1795,7 +1795,7 @@ public class ServiceSynchronize extends LifecycleService { if (!fetch) for (EntityAttachment attachment : attachments) if (!attachment.available) - if (attachment.size != null && attachment.size < ATTACHMENT_AUTO_DOWNLOAD_SIZE) { + if (!metered || (attachment.size != null && attachment.size < ATTACHMENT_AUTO_DOWNLOAD_SIZE)) { fetch = true; break; } @@ -1825,7 +1825,7 @@ public class ServiceSynchronize extends LifecycleService { for (int i = 0; i < attachments.size(); i++) { EntityAttachment attachment = attachments.get(i); if (!attachment.available) - if (attachment.size != null && attachment.size < ATTACHMENT_AUTO_DOWNLOAD_SIZE) { + if (!metered || (attachment.size != null && attachment.size < ATTACHMENT_AUTO_DOWNLOAD_SIZE)) { if (iattachments == null) iattachments = helper.getAttachments(); attachment.part = iattachments.get(i).part;