mirror of
https://github.com/chatmail/core.git
synced 2026-09-22 13:01:21 +03:00
fix: Don't download pre-message again if it is known already (#8488)
There was a bug in prefetch_should_download() that it made it return true for pre-messages even when they were already downloaded. This meant that pre-messages were downloaded from all relays, rather than just one, wasting internet data. The fix is in rfc724_mid_download_tried(), which is used by prefetch_should_download() to determine whether a message was already downloaded. --------- Co-authored-by: l <link2xt@testrun.org>
This commit is contained in:
@@ -1623,7 +1623,7 @@ pub(crate) async fn prefetch_should_download(
|
||||
message_id: &str,
|
||||
mut flags: impl Iterator<Item = Flag<'_>>,
|
||||
) -> Result<bool> {
|
||||
if message::rfc724_mid_download_tried(context, message_id).await? {
|
||||
if message::rfc724_mid_fetch_tried(context, message_id).await? {
|
||||
if let Some(from) = mimeparser::get_from(headers)
|
||||
&& context.is_self_addr(&from.addr).await?
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user