mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-15 08:29:24 +00:00
Added auto delete for junk folder
This commit is contained in:
parent
89361fffa6
commit
083a7fa49c
4 changed files with 2731 additions and 3 deletions
2717
app/schemas/eu.faircode.email.DB/225.json
Normal file
2717
app/schemas/eu.faircode.email.DB/225.json
Normal file
File diff suppressed because it is too large
Load diff
|
@ -3194,7 +3194,8 @@ class Core {
|
|||
for (Long tbd : tbds) {
|
||||
EntityMessage message = db.message().getMessage(tbd);
|
||||
if (message != null && trash != null)
|
||||
if (EntityFolder.TRASH.equals(folder.type))
|
||||
if (EntityFolder.TRASH.equals(folder.type) ||
|
||||
EntityFolder.JUNK.equals(folder.type))
|
||||
EntityOperation.queue(context, message, EntityOperation.DELETE);
|
||||
else
|
||||
EntityOperation.queue(context, message, EntityOperation.MOVE, trash.id);
|
||||
|
|
|
@ -71,7 +71,7 @@ import io.requery.android.database.sqlite.SQLiteDatabase;
|
|||
// https://developer.android.com/topic/libraries/architecture/room.html
|
||||
|
||||
@Database(
|
||||
version = 224,
|
||||
version = 225,
|
||||
entities = {
|
||||
EntityIdentity.class,
|
||||
EntityAccount.class,
|
||||
|
@ -2266,6 +2266,14 @@ public abstract class DB extends RoomDatabase {
|
|||
logMigration(startVersion, endVersion);
|
||||
db.execSQL("ALTER TABLE `attachment` ADD COLUMN `media_uri` TEXT");
|
||||
}
|
||||
}).addMigrations(new Migration(224, 225) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase db) {
|
||||
logMigration(startVersion, endVersion);
|
||||
db.execSQL("UPDATE folder" +
|
||||
" SET auto_delete = 0" +
|
||||
" WHERE type ='" + EntityFolder.JUNK + "'");
|
||||
}
|
||||
}).addMigrations(new Migration(998, 999) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase db) {
|
||||
|
|
|
@ -346,7 +346,9 @@ public class FragmentFolder extends FragmentBase {
|
|||
tvAutoClassifyPro.setVisibility(canAutoClassify && !pro ? View.VISIBLE : View.GONE);
|
||||
etKeepDays.setEnabled(!cbKeepAll.isChecked());
|
||||
cbAutoDelete.setEnabled(!cbKeepAll.isChecked());
|
||||
cbAutoDelete.setText(folder != null && EntityFolder.TRASH.equals(folder.type)
|
||||
cbAutoDelete.setText(folder != null &&
|
||||
(EntityFolder.TRASH.equals(folder.type) ||
|
||||
EntityFolder.JUNK.equals(folder.type))
|
||||
? R.string.title_auto_delete : R.string.title_auto_trash);
|
||||
grpAutoDelete.setVisibility(canAutoDelete ? View.VISIBLE : View.GONE);
|
||||
tvAutoDeleteArchiveHint.setVisibility(canAutoDelete && isArchive ? View.VISIBLE : View.GONE);
|
||||
|
|
Loading…
Add table
Reference in a new issue