fix: ignore parent message if message references itself

When there are no parent references,
Delta Chat inserts Message-ID into References.
Such references should be ignored
because otherwise fully downloaded message
may be assigned to the same chat as previously incorrectly assigned
partially downloaded message.

Fixes receive_imf::tests::test_create_group_with_big_msg
This commit is contained in:
link2xt
2024-05-10 22:25:46 +00:00
parent 8e38e7220b
commit 0d3c0a3d8f

View File

@@ -703,7 +703,9 @@ async fn add_parts(
better_msg = Some(stock_str::msg_location_enabled_by(context, from_id).await);
}
let parent = get_parent_message(context, mime_parser).await?;
let parent = get_parent_message(context, mime_parser)
.await?
.filter(|p| Some(p.id) != replace_msg_id);
let is_dc_message = if mime_parser.has_chat_version() {
MessengerMessage::Yes