feat: Assign message to ad-hoc group with matching name and members (#5385)

This should fix ad-hoc groups splitting when messages are fetched out of order from different
folders or otherwise reordered, or some messages are missing so that the messages reference chain is
broken, or a member was removed from the thread and readded later, etc. Even if this way two
different threads are merged, it looks acceptable, having many threads with the same name/subject
and members isn't a common use case.
This commit is contained in:
iequidoo
2024-07-15 11:25:33 -03:00
committed by iequidoo
parent c469fcb435
commit fe0c9958a6
3 changed files with 117 additions and 4 deletions

View File

@@ -1028,6 +1028,15 @@ CREATE INDEX msgs_status_updates_index2 ON msgs_status_updates (uid);
.await?;
}
inc_and_check(&mut migration_version, 121)?;
if dbversion < migration_version {
sql.execute_migration(
"CREATE INDEX chats_index4 ON chats (name)",
migration_version,
)
.await?;
}
let new_version = sql
.get_raw_config_int(VERSION_CFG)
.await?