Skip to content

Commit 6430977

Browse files
committed
fix: use non-empty To: field for "saved messages"
1 parent 8435f40 commit 6430977

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/chat/chat_tests.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,16 @@ async fn test_self_talk() -> Result<()> {
752752
assert!(msg.get_showpadlock());
753753

754754
let sent_msg = t.pop_sent_msg().await;
755+
let payload = sent_msg.payload();
756+
// Make sure the `To` field contains the address and not
757+
// "undisclosed recipients".
758+
// Otherwise Delta Chat core <1.153.0 assigns the message
759+
// to the trash chat.
760+
assert_eq!(
761+
payload.match_indices("To: <alice@example.org>\r\n").count(),
762+
1
763+
);
764+
755765
let t2 = TestContext::new_alice().await;
756766
t2.recv_msg(&sent_msg).await;
757767
let chat = &t2.get_self_chat().await;

src/mimefactory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ impl MimeFactory {
186186
if chat.is_self_talk() {
187187
if msg.param.get_cmd() == SystemMessage::AutocryptSetupMessage {
188188
recipients.push(from_addr.to_string());
189-
to.push((from_displayname.to_string(), from_addr.to_string()));
190189
}
190+
to.push((from_displayname.to_string(), from_addr.to_string()));
191191
} else if chat.is_mailing_list() {
192192
let list_post = chat
193193
.param

0 commit comments

Comments
 (0)