mirror of https://github.com/M66B/FairEmail.git
Prevent downloading headers when not needed
This commit is contained in:
parent
3e28f12de0
commit
ef20425ddf
|
@ -3654,13 +3654,6 @@ class Core {
|
|||
}
|
||||
}
|
||||
|
||||
boolean needsHeaders = EntityRule.needsHeaders(rules);
|
||||
boolean needsBody = EntityRule.needsBody(rules);
|
||||
if (needsHeaders || needsBody)
|
||||
Log.i(folder.name + " needs headers=" + needsHeaders + " body=" + needsBody);
|
||||
List<Header> headers = (needsHeaders ? helper.getAllHeaders() : null);
|
||||
String body = (needsBody ? helper.getMessageParts().getHtml(context) : null);
|
||||
|
||||
if (message == null) {
|
||||
Long sent = helper.getSent();
|
||||
|
||||
|
@ -3856,6 +3849,13 @@ class Core {
|
|||
}
|
||||
}
|
||||
|
||||
boolean needsHeaders = EntityRule.needsHeaders(rules);
|
||||
boolean needsBody = EntityRule.needsBody(rules);
|
||||
if (needsHeaders || needsBody)
|
||||
Log.i(folder.name + " needs headers=" + needsHeaders + " body=" + needsBody);
|
||||
List<Header> headers = (needsHeaders ? helper.getAllHeaders() : null);
|
||||
String body = (needsBody ? helper.getMessageParts().getHtml(context) : null);
|
||||
|
||||
try {
|
||||
db.beginTransaction();
|
||||
|
||||
|
@ -4077,7 +4077,14 @@ class Core {
|
|||
}
|
||||
}
|
||||
|
||||
if (update || process)
|
||||
if (update || process) {
|
||||
boolean needsHeaders = EntityRule.needsHeaders(rules);
|
||||
boolean needsBody = EntityRule.needsBody(rules);
|
||||
if (needsHeaders || needsBody)
|
||||
Log.i(folder.name + " needs headers=" + needsHeaders + " body=" + needsBody);
|
||||
List<Header> headers = (needsHeaders ? helper.getAllHeaders() : null);
|
||||
String body = (needsBody ? helper.getMessageParts().getHtml(context) : null);
|
||||
|
||||
try {
|
||||
db.beginTransaction();
|
||||
|
||||
|
@ -4090,6 +4097,7 @@ class Core {
|
|||
} finally {
|
||||
db.endTransaction();
|
||||
}
|
||||
}
|
||||
|
||||
if (process) {
|
||||
EntityContact.received(context, account, folder, message);
|
||||
|
|
Loading…
Reference in New Issue