mirror of
https://github.com/chatmail/core.git
synced 2026-05-06 16:36:59 +03:00
Fix all outgoing messages popping up in selfchat (#2456)
Fix https://github.com/deltachat/deltachat-android/issues/1940, fix https://github.com/deltachat/deltachat-core-rust/issues/2220 (I assume these are the same bug) The problem was: - Gmail adds a header `Bcc: <self-address>` to our bcc-self message - `to_id` was just set to the first recipient, in this case _self_ - it was seen that `to_id` is _self_, so it's a self-sent message
This commit is contained in:
@@ -3986,4 +3986,33 @@ YEAAAAAA!.
|
|||||||
.await,
|
.await,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[async_std::test]
|
||||||
|
async fn test_dont_show_all_outgoing_msgs_in_self_chat() {
|
||||||
|
// Regression test for https://github.com/deltachat/deltachat-android/issues/1940:
|
||||||
|
// Some servers add a `Bcc: <Self>` header, which caused all outgoing messages to
|
||||||
|
// be shown in the self-chat.
|
||||||
|
let t = TestContext::new_alice().await;
|
||||||
|
|
||||||
|
dc_receive_imf(
|
||||||
|
&t,
|
||||||
|
b"Bcc: alice@example.com
|
||||||
|
Received: from [127.0.0.1]
|
||||||
|
Subject: s
|
||||||
|
Chat-Version: 1.0
|
||||||
|
Message-ID: <abcd@gmail.com>
|
||||||
|
To: <me@other.maildomain.com>
|
||||||
|
From: <alice@example.com>
|
||||||
|
|
||||||
|
Message content",
|
||||||
|
"Inbox",
|
||||||
|
1,
|
||||||
|
false,
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
let msg = t.get_last_msg().await;
|
||||||
|
assert_ne!(msg.chat_id, t.get_self_chat().await.id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1585,7 +1585,7 @@ fn get_attachment_filename(
|
|||||||
/// Returned addresses are normalized and lowercased.
|
/// Returned addresses are normalized and lowercased.
|
||||||
pub(crate) fn get_recipients(headers: &[MailHeader]) -> Vec<SingleInfo> {
|
pub(crate) fn get_recipients(headers: &[MailHeader]) -> Vec<SingleInfo> {
|
||||||
get_all_addresses_from_header(headers, |header_key| {
|
get_all_addresses_from_header(headers, |header_key| {
|
||||||
header_key == "to" || header_key == "cc" || header_key == "bcc"
|
header_key == "to" || header_key == "cc"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user