mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-04 02:28:18 +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
|
// https://developer.android.com/topic/libraries/architecture/room.html
|
||||||
|
|
||||||
@Database(
|
@Database(
|
||||||
version = 289,
|
version = 290,
|
||||||
entities = {
|
entities = {
|
||||||
EntityIdentity.class,
|
EntityIdentity.class,
|
||||||
EntityAccount.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 `account` ADD COLUMN `dnssec` INTEGER NOT NULL DEFAULT 0");
|
||||||
db.execSQL("ALTER TABLE `identity` 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) {
|
}).addMigrations(new Migration(998, 999) {
|
||||||
@Override
|
@Override
|
||||||
public void migrate(@NonNull SupportSQLiteDatabase db) {
|
public void migrate(@NonNull SupportSQLiteDatabase db) {
|
||||||
|
|
|
@ -57,10 +57,6 @@ public interface DaoAccount {
|
||||||
" FROM message" +
|
" FROM message" +
|
||||||
" JOIN folder ON folder.id = message.folder" +
|
" JOIN folder ON folder.id = message.folder" +
|
||||||
" WHERE message.account = account.id" +
|
" 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.type <> '" + EntityFolder.OUTBOX + "'" +
|
||||||
" AND folder.count_unread" +
|
" AND folder.count_unread" +
|
||||||
" AND NOT ui_seen" +
|
" AND NOT ui_seen" +
|
||||||
|
@ -95,10 +91,6 @@ public interface DaoAccount {
|
||||||
" FROM message" +
|
" FROM message" +
|
||||||
" JOIN folder ON folder.id = message.folder" +
|
" JOIN folder ON folder.id = message.folder" +
|
||||||
" WHERE message.account = account.id" +
|
" 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.type <> '" + EntityFolder.OUTBOX + "'" +
|
||||||
" AND folder.count_unread" +
|
" AND folder.count_unread" +
|
||||||
" AND NOT ui_seen" +
|
" AND NOT ui_seen" +
|
||||||
|
|
Loading…
Add table
Reference in a new issue