-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle quote marks in the List-Id when setting chat name
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1058,6 +1058,30 @@ async fn test_mailing_list_multiple_names_in_subject() -> Result<()> { | |
Ok(()) | ||
} | ||
|
||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)] | ||
async fn test_mailing_list_with_quotes() -> Result<()> { | ||
let t = TestContext::new_alice().await; | ||
receive_imf( | ||
&t, | ||
b"From: Foo Bar <[email protected]>\n\ | ||
To: Alice <[email protected]>\n\ | ||
Subject: confirm xxyyzz\n\ | ||
Message-ID: <[email protected]>\n\ | ||
List-Id: \"Mailing list for \\\"Foo Bar\\\"\"\n\ | ||
<foo-bar.lists.example.net>\n\ | ||
Date: Sun, 22 Mar 2020 22:37:57 +0000\n\ | ||
\n\ | ||
hello\n", | ||
false, | ||
) | ||
.await?; | ||
let msg = t.get_last_msg().await; | ||
let chat_id = msg.get_chat_id(); | ||
let chat = Chat::load_from_db(&t, chat_id).await?; | ||
assert_eq!(chat.name, "Mailing list for \"Foo Bar\""); | ||
Ok(()) | ||
} | ||
|
||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)] | ||
async fn test_majordomo_mailing_list() -> Result<()> { | ||
let t = TestContext::new_alice().await; | ||
|