Sync folders on add account

pull/178/head
M66B 5 years ago
parent b637453ca7
commit e24ce5ead6

@ -368,6 +368,8 @@ public class FragmentGmail extends FragmentBase {
folder.account = account.id; folder.account = account.id;
folder.id = db.folder().insertFolder(folder); folder.id = db.folder().insertFolder(folder);
EntityLog.log(context, "Gmail folder=" + folder.name + " type=" + folder.type); EntityLog.log(context, "Gmail folder=" + folder.name + " type=" + folder.type);
if (folder.synchronize)
EntityOperation.sync(context, folder.id, false);
} }
} }

@ -493,6 +493,8 @@ public class FragmentOAuth extends FragmentBase {
folder.account = account.id; folder.account = account.id;
folder.id = db.folder().insertFolder(folder); folder.id = db.folder().insertFolder(folder);
EntityLog.log(context, "OAuth folder=" + folder.name + " type=" + folder.type); EntityLog.log(context, "OAuth folder=" + folder.name + " type=" + folder.type);
if (folder.synchronize)
EntityOperation.sync(context, folder.id, false);
} }
} }

@ -422,6 +422,9 @@ public class FragmentPop extends FragmentBase {
inbox.keep_days = Integer.MAX_VALUE; inbox.keep_days = Integer.MAX_VALUE;
inbox.initialize = 0; inbox.initialize = 0;
inbox.id = db.folder().insertFolder(inbox); inbox.id = db.folder().insertFolder(inbox);
if (account.synchronize)
EntityOperation.sync(context, inbox.id, false);
} }
EntityFolder drafts = db.folder().getFolderByType(account.id, EntityFolder.DRAFTS); EntityFolder drafts = db.folder().getFolderByType(account.id, EntityFolder.DRAFTS);
@ -474,7 +477,7 @@ public class FragmentPop extends FragmentBase {
db.endTransaction(); db.endTransaction();
} }
ServiceSynchronize.eval(context, "save account"); ServiceSynchronize.eval(context, "POP3");
if (!synchronize) { if (!synchronize) {
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);

Loading…
Cancel
Save