Fix folder settings

This commit is contained in:
M66B 2023-08-12 20:24:08 +02:00
parent 13411c2ef3
commit 5a2a9785fb
1 changed files with 17 additions and 0 deletions

View File

@ -2381,6 +2381,23 @@ class Core {
" keep_alive=" + keep_alive +
" force=" + force);
// Fix folder poll setting
boolean fixed = prefs.getBoolean("fixed_poll." + account.id, false);
if (!fixed && account.created != null && account.created > 1691193600 * 1000L /* August 5, 2023 */)
try {
EntityFolder inbox = db.folder().getFolderByType(account.id, EntityFolder.INBOX);
List<EntityFolder> children = db.folder().getChildFolders(inbox.id);
for (EntityFolder child : children)
if (!child.poll) {
db.folder().setFolderPoll(child.id, true);
EntityLog.log(context, "Fixed poll=" + child.name + ":" + child.type);
}
} catch (Throwable ex) {
Log.e(ex);
} finally {
prefs.edit().putBoolean("fixed_poll." + account.id, true).apply();
}
if (force)
sync_folders = true;
if (keep_alive)