Prevent folder add/delete loop

pull/146/head
M66B 6 years ago
parent 4831177e47
commit 02365af96b

@ -804,7 +804,7 @@ public class ServiceSynchronize extends LifecycleService {
public void folderRenamed(FolderEvent e) {
try {
wlAccount.acquire();
Log.i(Helper.TAG, "Folder renamed=" + e.getFolder());
Log.i(Helper.TAG, "Folder renamed=" + e.getFolder().getFullName());
String old = e.getFolder().getFullName();
String name = e.getNewFolder().getFullName();
@ -822,6 +822,9 @@ public class ServiceSynchronize extends LifecycleService {
try {
wlAccount.acquire();
Log.i(Helper.TAG, "Folder deleted=" + e.getFolder().getFullName());
EntityFolder folder = db.folder().getFolderByName(account.id, e.getFolder().getFullName());
if (folder != null)
db.folder().setFolderTbd(folder.id);
reload(ServiceSynchronize.this, "folder deleted");
} finally {
wlAccount.release();
@ -1800,6 +1803,7 @@ public class ServiceSynchronize extends LifecycleService {
names.add(folder.name);
else {
IMAPFolder ifolder = (IMAPFolder) istore.getFolder(folder.name);
if (ifolder.exists())
ifolder.delete(false);
db.folder().deleteFolder(folder.id);
}

Loading…
Cancel
Save