Clear headers on manual clean

This commit is contained in:
M66B 2019-09-30 12:45:37 +02:00
parent 213de839ad
commit f4f8614eed
2 changed files with 6 additions and 0 deletions

View File

@ -460,6 +460,9 @@ public interface DaoMessage {
@Query("UPDATE message SET notifying = 0") @Query("UPDATE message SET notifying = 0")
int clearNotifyingMessages(); int clearNotifyingMessages();
@Query("UPDATE message SET headers = NULL WHERE headers IS NOT NULL")
int clearMessageHeaders();
@Query("DELETE FROM message WHERE id = :id") @Query("DELETE FROM message WHERE id = :id")
int deleteMessage(long id); int deleteMessage(long id);

View File

@ -98,6 +98,9 @@ public class WorkerCleanup extends Worker {
// Restore alarms // Restore alarms
for (EntityMessage message : db.message().getSnoozed()) for (EntityMessage message : db.message().getSnoozed())
EntityMessage.snooze(context, message.id, message.ui_snoozed); EntityMessage.snooze(context, message.id, message.ui_snoozed);
int headers = db.message().clearMessageHeaders();
Log.i("Cleared message headers=" + headers);
} }
long now = new Date().getTime(); long now = new Date().getTime();