-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
3 changed files
with
87 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -203,6 +203,41 @@ async fn test_adhoc_group_show_all() { | |
assert_eq!(chat::get_chat_contacts(&t, chat_id).await.unwrap().len(), 3); | ||
} | ||
|
||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)] | ||
async fn test_adhoc_groups_merge() -> Result<()> { | ||
let mut tcm = TestContextManager::new(); | ||
let alice = &tcm.alice().await; | ||
receive_imf( | ||
alice, | ||
b"From: [email protected]\n\ | ||
To: [email protected], [email protected]\n\ | ||
Message-ID: <[email protected]>\n\ | ||
Date: Sun, 22 Mar 2020 22:37:57 +0000\n\ | ||
Subject: New thread\n\ | ||
\n\ | ||
The first of us should create a thread as discussed\n", | ||
false, | ||
) | ||
.await?; | ||
receive_imf( | ||
alice, | ||
b"From: [email protected]\n\ | ||
To: [email protected], [email protected]\n\ | ||
Message-ID: <[email protected]>\n\ | ||
Date: Sun, 22 Mar 2020 22:37:58 +0000\n\ | ||
Subject: New thread\n\ | ||
\n\ | ||
The first of us should create a thread as discussed\n", | ||
false, | ||
) | ||
.await?; | ||
let chats = Chatlist::try_load(alice, 0, None, None).await?; | ||
assert_eq!(chats.len(), 1); | ||
let chat_id = chats.get_chat_id(0)?; | ||
assert_eq!(chat_id.get_msg_cnt(alice).await?, 2); | ||
Ok(()) | ||
} | ||
|
||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)] | ||
async fn test_read_receipt_and_unarchive() -> Result<()> { | ||
// create alice's account | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters