1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-02-21 21:57:19 +00:00

Prevent cleanup of message headers / EML files

This commit is contained in:
M66B 2021-07-25 09:05:04 +02:00
parent d49ef3d8fa
commit 9801a4527a

View file

@ -92,6 +92,8 @@ public class WorkerCleanup extends Worker {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean fts = prefs.getBoolean("fts", true);
boolean cleanup_attachments = prefs.getBoolean("cleanup_attachments", false);
boolean download_headers = prefs.getBoolean("download_headers", false);
boolean download_eml = prefs.getBoolean("download_eml", false);
long start = new Date().getTime();
DB db = DB.getInstance(context);
@ -133,9 +135,11 @@ public class WorkerCleanup extends Worker {
Log.i("Attachments purged=" + purged);
// Clear raw headers
if (!download_headers) {
int headers = db.message().clearMessageHeaders();
Log.i("Cleared message headers=" + headers);
}
}
// Restore alarms
for (EntityMessage message : db.message().getSnoozed(null))
@ -225,6 +229,7 @@ public class WorkerCleanup extends Worker {
}
// Cleanup message files
if (!download_eml) {
Log.i("Cleanup raw message files");
File[] raws = new File(context.getFilesDir(), "raw").listFiles();
if (raws != null)
@ -238,6 +243,7 @@ public class WorkerCleanup extends Worker {
Log.w("Error deleting " + file);
}
}
}
// Cleanup attachment files
Log.i("Cleanup attachment files");