|
|
|
@ -335,19 +335,21 @@ public class FragmentFolders extends FragmentBase {
|
|
|
|
|
try {
|
|
|
|
|
db.beginTransaction();
|
|
|
|
|
|
|
|
|
|
if (aid < 0) {
|
|
|
|
|
// Unified inbox
|
|
|
|
|
List<EntityFolder> folders = db.folder().getFoldersUnified(null, true);
|
|
|
|
|
for (EntityFolder folder : folders) {
|
|
|
|
|
EntityOperation.sync(context, folder.id, true);
|
|
|
|
|
|
|
|
|
|
if (folder.account == null)
|
|
|
|
|
outbox = true;
|
|
|
|
|
else {
|
|
|
|
|
EntityAccount account = db.account().getAccount(folder.account);
|
|
|
|
|
if (account != null && !"connected".equals(account.state))
|
|
|
|
|
now = false;
|
|
|
|
|
}
|
|
|
|
|
List<EntityFolder> folders;
|
|
|
|
|
if (aid < 0)
|
|
|
|
|
folders = db.folder().getFoldersUnified(null, true);
|
|
|
|
|
else
|
|
|
|
|
folders = db.folder().getSynchronizingFolders(aid);
|
|
|
|
|
|
|
|
|
|
for (EntityFolder folder : folders) {
|
|
|
|
|
EntityOperation.sync(context, folder.id, true);
|
|
|
|
|
|
|
|
|
|
if (folder.account == null)
|
|
|
|
|
outbox = true;
|
|
|
|
|
else {
|
|
|
|
|
EntityAccount account = db.account().getAccount(folder.account);
|
|
|
|
|
if (account != null && !"connected".equals(account.state))
|
|
|
|
|
now = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -356,10 +358,7 @@ public class FragmentFolders extends FragmentBase {
|
|
|
|
|
db.endTransaction();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (aid < 0)
|
|
|
|
|
ServiceSynchronize.eval(context, "refresh/folders");
|
|
|
|
|
else
|
|
|
|
|
ServiceSynchronize.reload(context, aid, "refresh/folders");
|
|
|
|
|
ServiceSynchronize.eval(context, "refresh/folders");
|
|
|
|
|
|
|
|
|
|
if (outbox)
|
|
|
|
|
ServiceSend.start(context);
|
|
|
|
|