mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-22 14:11:00 +00:00
Prevent cleanup of message headers / EML files
This commit is contained in:
parent
d49ef3d8fa
commit
9801a4527a
1 changed files with 20 additions and 14 deletions
|
@ -92,6 +92,8 @@ public class WorkerCleanup extends Worker {
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
boolean fts = prefs.getBoolean("fts", true);
|
boolean fts = prefs.getBoolean("fts", true);
|
||||||
boolean cleanup_attachments = prefs.getBoolean("cleanup_attachments", false);
|
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();
|
long start = new Date().getTime();
|
||||||
DB db = DB.getInstance(context);
|
DB db = DB.getInstance(context);
|
||||||
|
@ -133,9 +135,11 @@ public class WorkerCleanup extends Worker {
|
||||||
Log.i("Attachments purged=" + purged);
|
Log.i("Attachments purged=" + purged);
|
||||||
|
|
||||||
// Clear raw headers
|
// Clear raw headers
|
||||||
|
if (!download_headers) {
|
||||||
int headers = db.message().clearMessageHeaders();
|
int headers = db.message().clearMessageHeaders();
|
||||||
Log.i("Cleared message headers=" + headers);
|
Log.i("Cleared message headers=" + headers);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Restore alarms
|
// Restore alarms
|
||||||
for (EntityMessage message : db.message().getSnoozed(null))
|
for (EntityMessage message : db.message().getSnoozed(null))
|
||||||
|
@ -225,6 +229,7 @@ public class WorkerCleanup extends Worker {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cleanup message files
|
// Cleanup message files
|
||||||
|
if (!download_eml) {
|
||||||
Log.i("Cleanup raw message files");
|
Log.i("Cleanup raw message files");
|
||||||
File[] raws = new File(context.getFilesDir(), "raw").listFiles();
|
File[] raws = new File(context.getFilesDir(), "raw").listFiles();
|
||||||
if (raws != null)
|
if (raws != null)
|
||||||
|
@ -238,6 +243,7 @@ public class WorkerCleanup extends Worker {
|
||||||
Log.w("Error deleting " + file);
|
Log.w("Error deleting " + file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Cleanup attachment files
|
// Cleanup attachment files
|
||||||
Log.i("Cleanup attachment files");
|
Log.i("Cleanup attachment files");
|
||||||
|
|
Loading…
Reference in a new issue