Unique thread / account

pull/207/head
M66B 3 years ago
parent 8d7876f4fb
commit 1ee4717659

File diff suppressed because it is too large Load Diff

@ -71,7 +71,7 @@ import io.requery.android.database.sqlite.SQLiteDatabase;
// https://developer.android.com/topic/libraries/architecture/room.html
@Database(
version = 230,
version = 231,
entities = {
EntityIdentity.class,
EntityAccount.class,
@ -2307,6 +2307,12 @@ public abstract class DB extends RoomDatabase {
db.execSQL("ALTER TABLE `folder` ADD COLUMN `hide_seen` INTEGER NOT NULL DEFAULT 0");
db.execSQL("UPDATE `folder` SET hide = 0 WHERE unified");
}
}).addMigrations(new Migration(230, 231) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase db) {
logMigration(startVersion, endVersion);
db.execSQL("UPDATE `message` SET thread = account || ':' || thread");
}
}).addMigrations(new Migration(998, 999) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase db) {

@ -1548,11 +1548,11 @@ public class MessageHelper {
if (thread == null && refs.size() > 0) {
String ref = refs.get(0);
if (!Objects.equals(ref, msgid))
thread = ref;
thread = account + ":" + ref;
}
if (thread == null)
thread = getHash() + ":" + uid;
thread = account + ":" + getHash() + ":" + uid;
// Sent before
for (TupleThreadInfo info : infos)

Loading…
Cancel
Save