Show threading count / outbox

This commit is contained in:
M66B
2022-04-04 19:40:38 +02:00
parent f4d6dcdada
commit f59a6ddf55
4 changed files with 2743 additions and 4 deletions

View File

@@ -71,7 +71,7 @@ import io.requery.android.database.sqlite.SQLiteDatabase;
// https://developer.android.com/topic/libraries/architecture/room.html
@Database(
version = 228,
version = 229,
entities = {
EntityIdentity.class,
EntityAccount.class,
@@ -1617,7 +1617,8 @@ public abstract class DB extends RoomDatabase {
logMigration(startVersion, endVersion);
db.execSQL("CREATE VIEW IF NOT EXISTS `account_view` AS " +
TupleAccountView.query.replace(", category", ""));
db.execSQL("CREATE VIEW IF NOT EXISTS `identity_view` AS " + TupleIdentityView.query);
db.execSQL("CREATE VIEW IF NOT EXISTS `identity_view` AS " +
TupleIdentityView.query.replace(", account", ""));
db.execSQL("CREATE VIEW IF NOT EXISTS `folder_view` AS " + TupleFolderView.query);
}
})
@@ -2305,6 +2306,13 @@ public abstract class DB extends RoomDatabase {
logMigration(startVersion, endVersion);
db.execSQL("ALTER TABLE `contact` ADD COLUMN `group` TEXT");
}
}).addMigrations(new Migration(228, 229) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase db) {
logMigration(startVersion, endVersion);
db.execSQL("DROP VIEW IF EXISTS `identity_view`");
db.execSQL("CREATE VIEW IF NOT EXISTS `identity_view` AS " + TupleIdentityView.query);
}
}).addMigrations(new Migration(998, 999) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase db) {

View File

@@ -163,7 +163,7 @@ public interface DaoMessage {
" LEFT JOIN identity_view AS identity ON identity.id = message.identity" +
" JOIN folder_view AS folder ON folder.id = message.folder" +
" JOIN folder_view AS f ON f.id = :folder" +
" WHERE (message.account = f.account OR " + is_outbox + ")" +
" WHERE (message.account = f.account OR message.account = identity.account OR " + is_outbox + ")" +
" AND (:threading OR folder.id = :folder)" +
" AND (NOT message.ui_hide OR :debug)" +
" AND (NOT :found OR message.ui_found = :found)" +

View File

@@ -30,7 +30,7 @@ import java.util.Objects;
value = TupleIdentityView.query
)
public class TupleIdentityView {
static final String query = "SELECT id, name, email, display, color, synchronize FROM identity";
static final String query = "SELECT id, name, email, account, display, color, synchronize FROM identity";
@NonNull
public Long id;
@@ -38,6 +38,8 @@ public class TupleIdentityView {
public String name;
@NonNull
public String email;
@NonNull
public Long account;
public String display;
public Integer color;
@NonNull