mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-28 02:37:16 +00:00
Reselect Gmail archive folder if needed
This commit is contained in:
parent
ed0ea8f526
commit
cb2bb0f5d7
1 changed files with 17 additions and 0 deletions
|
@ -2061,6 +2061,23 @@ class Core {
|
|||
folder.name = fullName;
|
||||
db.folder().setFolderName(folder.id, fullName);
|
||||
}
|
||||
|
||||
// Reselect Gmail archive folder
|
||||
if (EntityFolder.ARCHIVE.equals(type) && account.isGmail()) {
|
||||
boolean gmail_archive_fixed = prefs.getBoolean("gmail_archive_fixed", false);
|
||||
if (!gmail_archive_fixed) {
|
||||
prefs.edit().putBoolean("gmail_archive_fixed", true).apply();
|
||||
EntityFolder archive = db.folder().getFolderByType(account.id, EntityFolder.ARCHIVE);
|
||||
if (archive == null) {
|
||||
archive = db.folder().getFolderByName(account.id, fullName);
|
||||
if (archive != null) {
|
||||
Log.e("Reselecting Gmail archive=" + fullName);
|
||||
archive.type = EntityFolder.ARCHIVE;
|
||||
db.folder().setFolderType(archive.id, archive.type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue