Download headers/EML fixes/improvements

This commit is contained in:
M66B 2021-04-26 10:12:29 +02:00
parent 317363793c
commit 54db9dc290
2 changed files with 10 additions and 1 deletions

View File

@ -3499,6 +3499,12 @@ class Core {
" labels=" + (labels == null ? null : TextUtils.join(" ", labels)));
}
if (download_headers && message.headers == null) {
update = true;
message.headers = helper.getHeaders();
Log.i(folder.name + " updated id=" + message.id + " headers");
}
if (message.hash == null || process) {
update = true;
message.hash = helper.getHash();
@ -3791,13 +3797,15 @@ class Core {
}
if (download_eml &&
(message.raw == null || !message.raw) &&
(state.getNetworkState().isUnmetered() || (message.total != null && message.total < maxSize))) {
File file = message.getRawFile(context);
try (OutputStream os = new BufferedOutputStream(new FileOutputStream(file))) {
imessage.writeTo(os);
}
db.message().setMessageRaw(message.id, true);
message.raw = true;
db.message().setMessageRaw(message.id, message.raw);
}
return fetch;

View File

@ -147,6 +147,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
"sync_kept",
"sync_folders",
"sync_shared_folders",
"download_headers", "download_eml",
"prefer_ip4", "standalone_vpn", "tcp_keep_alive", "ssl_harden", // force reconnect
"experiments", "debug", "protocol", // force reconnect
"auth_plain", "auth_login", "auth_ntlm", "auth_sasl" // force reconnect