Delete local POP3 message/attachment files

pull/187/head
M66B 4 years ago
parent 7952c3da3d
commit acf43a6891

@ -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();

@ -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")

Loading…
Cancel
Save