Prevent deleting local messages with pending add operation

This commit is contained in:
M66B 2019-01-26 18:11:51 +00:00
parent 90d4d51e18
commit e2b89a8703
1 changed files with 5 additions and 1 deletions

View File

@ -371,7 +371,11 @@ public interface DaoMessage {
@Query("DELETE FROM message" +
" WHERE folder = :folder" +
" AND uid IS NULL" +
" AND NOT ui_browsed")
" AND NOT ui_browsed" +
" AND NOT EXISTS" +
" (SELECT * FROM operation" +
" WHERE operation.message = message.id" +
" AND operation.name = '" + EntityOperation.ADD + "')")
int deleteOrphans(long folder);
@Query("DELETE FROM message" +