mirror of https://github.com/M66B/FairEmail.git
Cleanup orphaned messages
This commit is contained in:
parent
fd405deea7
commit
0136ddfa30
|
@ -332,6 +332,11 @@ public interface DaoMessage {
|
|||
" AND NOT uid IS NULL")
|
||||
int deleteLocalMessages(long folder);
|
||||
|
||||
@Query("DELETE FROM message" +
|
||||
" WHERE folder = :folder" +
|
||||
" AND uid IS NULL")
|
||||
int deleteOrphans(long folder);
|
||||
|
||||
@Query("DELETE FROM message" +
|
||||
" WHERE folder = :folder" +
|
||||
" AND seen")
|
||||
|
|
|
@ -2234,6 +2234,9 @@ public class ServiceSynchronize extends LifecycleService {
|
|||
}
|
||||
}
|
||||
|
||||
// Delete not synchronized messages without uid
|
||||
db.message().deleteOrphans(folder.id);
|
||||
|
||||
db.folder().setFolderSyncState(folder.id, "downloading");
|
||||
|
||||
//fp.add(IMAPFolder.FetchProfileItem.MESSAGE);
|
||||
|
|
Loading…
Reference in New Issue