From 8c7dbff7b38568ac7d19278f4116b466aa850387 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 26 Oct 2021 08:00:38 +0200 Subject: [PATCH] Clear local contacts only --- app/src/main/java/eu/faircode/email/DaoContact.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/DaoContact.java b/app/src/main/java/eu/faircode/email/DaoContact.java index 5dd79a5d64..78a311e497 100644 --- a/app/src/main/java/eu/faircode/email/DaoContact.java +++ b/app/src/main/java/eu/faircode/email/DaoContact.java @@ -97,9 +97,13 @@ public interface DaoContact { @Query("DELETE FROM contact" + " WHERE last_contacted IS NOT NULL" + " AND last_contacted < :before" + - " AND state <> " + EntityContact.STATE_FAVORITE) + " AND state <> " + EntityContact.STATE_FAVORITE + + " AND (type = " + EntityContact.TYPE_TO + + " OR type = " + EntityContact.TYPE_FROM + ")") int deleteContacts(long before); - @Query("DELETE FROM contact") + @Query("DELETE FROM contact" + + " WHERE (type = " + EntityContact.TYPE_TO + + " OR type = " + EntityContact.TYPE_FROM + ")") int clearContacts(); }