Browse Source

Make sure to delete local messages only

main
M66B 6 years ago
parent
commit
92d839fb8c
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      app/src/main/java/eu/faircode/email/AdapterFolder.java
  2. +2
    -2
      app/src/main/java/eu/faircode/email/DaoMessage.java

+ 1
- 1
app/src/main/java/eu/faircode/email/AdapterFolder.java View File

@ -204,7 +204,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
if (outbox) if (outbox)
DB.getInstance(context).message().deleteSeenMessages(id); DB.getInstance(context).message().deleteSeenMessages(id);
else else
DB.getInstance(context).message().deleteMessages(id);
DB.getInstance(context).message().deleteLocalMessages(id);
return null; return null;
} }


+ 2
- 2
app/src/main/java/eu/faircode/email/DaoMessage.java View File

@ -193,8 +193,8 @@ public interface DaoMessage {
@Query("DELETE FROM message WHERE folder = :folder AND uid = :uid") @Query("DELETE FROM message WHERE folder = :folder AND uid = :uid")
int deleteMessage(long folder, long uid); int deleteMessage(long folder, long uid);
@Query("DELETE FROM message WHERE folder = :folder")
int deleteMessages(long folder);
@Query("DELETE FROM message WHERE folder = :folder AND NOT uid IS NULL")
int deleteLocalMessages(long folder);
@Query("DELETE FROM message WHERE folder = :folder AND seen") @Query("DELETE FROM message WHERE folder = :folder AND seen")
int deleteSeenMessages(long folder); int deleteSeenMessages(long folder);


Loading…
Cancel
Save