1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-25 01:06:04 +00:00

Delete local POP3 message/attachment files

This commit is contained in:
M66B 2020-10-24 17:55:46 +02:00
parent 7952c3da3d
commit acf43a6891
2 changed files with 10 additions and 1 deletions

View file

@ -1273,7 +1273,11 @@ class Core {
DB db = DB.getInstance(context);
if (EntityFolder.INBOX.equals(folder.type)) {
if (!account.leave_deleted) {
if (account.leave_deleted) {
// Remove message/attachments files on cleanup
db.message().resetMessageContent(message.id);
db.attachment().resetAvailable(message.id);
} else {
Map<String, String> caps = istore.capabilities();
Message[] imessages = ifolder.getMessages();

View file

@ -82,6 +82,11 @@ public interface DaoAttachment {
" WHERE id = :id")
void setAvailable(long id, boolean available);
@Query("UPDATE attachment" +
" SET size = NULL, progress = NULL, available = 0" +
" WHERE message = :message")
void resetAvailable(long message);
@Query("UPDATE attachment" +
" SET error = :error, progress = NULL, available = 0" +
" WHERE id = :id")