mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-05 08:33:37 +02:00
Unique thread / account
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user