mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-03 18:26:20 +00:00
Allow counting in archive, junk trash and drafts folders
This commit is contained in:
parent
e6574ce6a8
commit
7f23409648
3 changed files with 3025 additions and 9 deletions
3015
app/schemas/eu.faircode.email.DB/290.json
Normal file
3015
app/schemas/eu.faircode.email.DB/290.json
Normal file
File diff suppressed because it is too large
Load diff
|
@ -67,7 +67,7 @@ import javax.mail.internet.InternetAddress;
|
|||
// https://developer.android.com/topic/libraries/architecture/room.html
|
||||
|
||||
@Database(
|
||||
version = 289,
|
||||
version = 290,
|
||||
entities = {
|
||||
EntityIdentity.class,
|
||||
EntityAccount.class,
|
||||
|
@ -2923,6 +2923,15 @@ public abstract class DB extends RoomDatabase {
|
|||
db.execSQL("ALTER TABLE `account` ADD COLUMN `dnssec` INTEGER NOT NULL DEFAULT 0");
|
||||
db.execSQL("ALTER TABLE `identity` ADD COLUMN `dnssec` INTEGER NOT NULL DEFAULT 0");
|
||||
}
|
||||
}).addMigrations(new Migration(289, 290) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase db) {
|
||||
logMigration(startVersion, endVersion);
|
||||
db.execSQL("UPDATE `folder` SET `count_unread` = 0 WHERE `type` = '" + EntityFolder.ARCHIVE + "'");
|
||||
db.execSQL("UPDATE `folder` SET `count_unread` = 0 WHERE `type` = '" + EntityFolder.TRASH + "'");
|
||||
db.execSQL("UPDATE `folder` SET `count_unread` = 0 WHERE `type` = '" + EntityFolder.JUNK + "'");
|
||||
db.execSQL("UPDATE `folder` SET `count_unread` = 0 WHERE `type` = '" + EntityFolder.DRAFTS + "'");
|
||||
}
|
||||
}).addMigrations(new Migration(998, 999) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase db) {
|
||||
|
|
|
@ -57,10 +57,6 @@ public interface DaoAccount {
|
|||
" FROM message" +
|
||||
" JOIN folder ON folder.id = message.folder" +
|
||||
" WHERE message.account = account.id" +
|
||||
" AND folder.type <> '" + EntityFolder.ARCHIVE + "'" +
|
||||
" AND folder.type <> '" + EntityFolder.TRASH + "'" +
|
||||
" AND folder.type <> '" + EntityFolder.JUNK + "'" +
|
||||
" AND folder.type <> '" + EntityFolder.DRAFTS + "'" +
|
||||
" AND folder.type <> '" + EntityFolder.OUTBOX + "'" +
|
||||
" AND folder.count_unread" +
|
||||
" AND NOT ui_seen" +
|
||||
|
@ -95,10 +91,6 @@ public interface DaoAccount {
|
|||
" FROM message" +
|
||||
" JOIN folder ON folder.id = message.folder" +
|
||||
" WHERE message.account = account.id" +
|
||||
" AND folder.type <> '" + EntityFolder.ARCHIVE + "'" +
|
||||
" AND folder.type <> '" + EntityFolder.TRASH + "'" +
|
||||
" AND folder.type <> '" + EntityFolder.JUNK + "'" +
|
||||
" AND folder.type <> '" + EntityFolder.DRAFTS + "'" +
|
||||
" AND folder.type <> '" + EntityFolder.OUTBOX + "'" +
|
||||
" AND folder.count_unread" +
|
||||
" AND NOT ui_seen" +
|
||||
|
|
Loading…
Reference in a new issue