From abaf3926a8c0032ee16c29be7310adebf9c4e7aa Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 22 Sep 2019 09:53:55 +0200 Subject: [PATCH] Revert "Fetch body structure on download" This reverts commit 0f1d7fe33b4fbb8cfe9b89e35e185e4fe21b5941. --- .../faircode/email/BoundaryCallbackMessages.java | 1 + app/src/main/java/eu/faircode/email/Core.java | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java b/app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java index 967faf18ed..766f54bec6 100644 --- a/app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java +++ b/app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java @@ -449,6 +449,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback rules = db.rule().getEnabledRules(folder.id); fp.add(FetchProfile.Item.ENVELOPE); - // fp.add(FetchProfile.Item.FLAGS); + //fp.add(FetchProfile.Item.FLAGS); fp.add(FetchProfile.Item.CONTENT_INFO); // body structure - // fp.add(UIDFolder.FetchProfileItem.UID); + //fp.add(UIDFolder.FetchProfileItem.UID); fp.add(IMAPFolder.FetchProfileItem.HEADERS); - // fp.add(IMAPFolder.FetchProfileItem.MESSAGE); + //fp.add(IMAPFolder.FetchProfileItem.MESSAGE); fp.add(FetchProfile.Item.SIZE); fp.add(IMAPFolder.FetchProfileItem.INTERNALDATE); @@ -2183,16 +2183,18 @@ class Core { if (fetch) { Log.i(folder.name + " fetching message id=" + message.id); - FetchProfile fp = new FetchProfile(); + // Fetch on demand to prevent OOM + + //FetchProfile fp = new FetchProfile(); //fp.add(FetchProfile.Item.ENVELOPE); //fp.add(FetchProfile.Item.FLAGS); - fp.add(FetchProfile.Item.CONTENT_INFO); // body structure + //fp.add(FetchProfile.Item.CONTENT_INFO); // body structure //fp.add(UIDFolder.FetchProfileItem.UID); //fp.add(IMAPFolder.FetchProfileItem.HEADERS); //fp.add(IMAPFolder.FetchProfileItem.MESSAGE); //fp.add(FetchProfile.Item.SIZE); //fp.add(IMAPFolder.FetchProfileItem.INTERNALDATE); - ifolder.fetch(new Message[]{imessage}, fp); + //ifolder.fetch(new Message[]{imessage}, fp); MessageHelper helper = new MessageHelper(imessage); MessageHelper.MessageParts parts = helper.getMessageParts();