Download headers/EML fixes/improvements

pull/198/head
M66B 4 years ago
parent 317363793c
commit 54db9dc290

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

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

Loading…
Cancel
Save