From f4f8614eed928a48c51c2dfb6e038d7b8481e4b5 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 30 Sep 2019 12:45:37 +0200 Subject: [PATCH] Clear headers on manual clean --- app/src/main/java/eu/faircode/email/DaoMessage.java | 3 +++ app/src/main/java/eu/faircode/email/WorkerCleanup.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/DaoMessage.java b/app/src/main/java/eu/faircode/email/DaoMessage.java index 4947457231..1e09bf3ddf 100644 --- a/app/src/main/java/eu/faircode/email/DaoMessage.java +++ b/app/src/main/java/eu/faircode/email/DaoMessage.java @@ -460,6 +460,9 @@ public interface DaoMessage { @Query("UPDATE message SET notifying = 0") int clearNotifyingMessages(); + @Query("UPDATE message SET headers = NULL WHERE headers IS NOT NULL") + int clearMessageHeaders(); + @Query("DELETE FROM message WHERE id = :id") int deleteMessage(long id); diff --git a/app/src/main/java/eu/faircode/email/WorkerCleanup.java b/app/src/main/java/eu/faircode/email/WorkerCleanup.java index f5cb2b8546..f594562704 100644 --- a/app/src/main/java/eu/faircode/email/WorkerCleanup.java +++ b/app/src/main/java/eu/faircode/email/WorkerCleanup.java @@ -98,6 +98,9 @@ public class WorkerCleanup extends Worker { // Restore alarms for (EntityMessage message : db.message().getSnoozed()) EntityMessage.snooze(context, message.id, message.ui_snoozed); + + int headers = db.message().clearMessageHeaders(); + Log.i("Cleared message headers=" + headers); } long now = new Date().getTime();