|
|
|
@ -1237,7 +1237,7 @@ class Core {
|
|
|
|
|
int count = ifolder.getMessageCount();
|
|
|
|
|
db.folder().setFolderTotal(folder.id, count < 0 ? null : count);
|
|
|
|
|
|
|
|
|
|
if (download) {
|
|
|
|
|
if (download && folder.initialize == 0) {
|
|
|
|
|
db.folder().setFolderSyncState(folder.id, "downloading");
|
|
|
|
|
|
|
|
|
|
// Download messages/attachments
|
|
|
|
@ -1274,9 +1274,21 @@ class Core {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (state.running) {
|
|
|
|
|
if (state.running && folder.initialize != 0) {
|
|
|
|
|
folder.initialize = 0;
|
|
|
|
|
db.folder().setFolderInitialize(folder.id, 0);
|
|
|
|
|
|
|
|
|
|
// Schedule download
|
|
|
|
|
if (download) {
|
|
|
|
|
EntityOperation operation = new EntityOperation();
|
|
|
|
|
operation.account = folder.account;
|
|
|
|
|
operation.folder = folder.id;
|
|
|
|
|
operation.message = null;
|
|
|
|
|
operation.name = EntityOperation.SYNC;
|
|
|
|
|
operation.args = jargs.toString();
|
|
|
|
|
operation.created = new Date().getTime();
|
|
|
|
|
operation.id = db.operation().insertOperation(operation);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
db.folder().setFolderSync(folder.id, new Date().getTime());
|
|
|
|
|