mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-31 20:25:38 +00:00
Clear raw message files if disabled
This commit is contained in:
parent
edb0023fad
commit
f4bb651fd9
2 changed files with 12 additions and 1 deletions
|
@ -862,6 +862,11 @@ public interface DaoMessage {
|
|||
" AND account IN (SELECT id FROM account WHERE pop = " + EntityAccount.TYPE_IMAP + ")")
|
||||
int clearMessageHeaders();
|
||||
|
||||
@Query("UPDATE message SET raw = NULL" +
|
||||
" WHERE raw IS NOT NULL" +
|
||||
" AND account IN (SELECT id FROM account WHERE pop = " + EntityAccount.TYPE_IMAP + ")")
|
||||
int clearRawMessages();
|
||||
|
||||
@Query("UPDATE message SET fts = 0 WHERE NOT (fts IS 0)")
|
||||
int resetFts();
|
||||
|
||||
|
|
|
@ -139,6 +139,12 @@ public class WorkerCleanup extends Worker {
|
|||
int headers = db.message().clearMessageHeaders();
|
||||
Log.i("Cleared message headers=" + headers);
|
||||
}
|
||||
|
||||
// Clear raw message files
|
||||
if (!download_eml) {
|
||||
int eml = db.message().clearRawMessages();
|
||||
Log.i("Cleared raw messages=" + eml);
|
||||
}
|
||||
}
|
||||
|
||||
// Restore alarms
|
||||
|
@ -228,7 +234,7 @@ public class WorkerCleanup extends Worker {
|
|||
}
|
||||
}
|
||||
|
||||
// Cleanup message files
|
||||
// Cleanup raw message files
|
||||
if (!download_eml) {
|
||||
Log.i("Cleanup raw message files");
|
||||
File[] raws = new File(context.getFilesDir(), "raw").listFiles();
|
||||
|
|
Loading…
Reference in a new issue