@@ -19,15 +19,14 @@ use async_imap::types::{Fetch, Flag, Name, NameAttribute, UnsolicitedResponse};
1919use deltachat_contact_tools:: ContactAddress ;
2020use futures:: { FutureExt as _, TryStreamExt } ;
2121use futures_lite:: FutureExt ;
22- use num_traits:: FromPrimitive ;
2322use ratelimit:: Ratelimit ;
2423use url:: Url ;
2524
2625use crate :: calls:: { create_fallback_ice_servers, create_ice_servers_from_metadata} ;
2726use crate :: chat:: { self , ChatId , ChatIdBlocked , add_device_msg} ;
2827use crate :: chatlist_events;
2928use crate :: config:: Config ;
30- use crate :: constants:: { self , Blocked , Chattype , DC_VERSION_STR , ShowEmails } ;
29+ use crate :: constants:: { self , Blocked , Chattype , DC_VERSION_STR } ;
3130use crate :: contact:: { Contact , ContactId , Modifier , Origin } ;
3231use crate :: context:: Context ;
3332use crate :: events:: EventType ;
@@ -2317,7 +2316,7 @@ pub(crate) async fn prefetch_should_download(
23172316 Some ( f) => f,
23182317 None => return Ok ( false ) ,
23192318 } ;
2320- let ( _from_id, blocked_contact, origin ) =
2319+ let ( _from_id, blocked_contact, _origin ) =
23212320 match from_field_to_contact_id ( context, & from, None , true , true ) . await ? {
23222321 Some ( res) => res,
23232322 None => return Ok ( false ) ,
@@ -2330,29 +2329,7 @@ pub(crate) async fn prefetch_should_download(
23302329 return Ok ( false ) ;
23312330 }
23322331
2333- let is_chat_message = headers. get_header_value ( HeaderDef :: ChatVersion ) . is_some ( ) ;
2334- let accepted_contact = origin. is_known ( ) ;
2335- let is_reply_to_chat_message = get_prefetch_parent_message ( context, headers)
2336- . await ?
2337- . map ( |parent| match parent. is_dc_message {
2338- MessengerMessage :: No => false ,
2339- MessengerMessage :: Yes | MessengerMessage :: Reply => true ,
2340- } )
2341- . unwrap_or_default ( ) ;
2342-
2343- let show_emails =
2344- ShowEmails :: from_i32 ( context. get_config_int ( Config :: ShowEmails ) . await ?) . unwrap_or_default ( ) ;
2345-
2346- let show = is_autocrypt_setup_message
2347- || match show_emails {
2348- ShowEmails :: Off => is_chat_message || is_reply_to_chat_message,
2349- ShowEmails :: AcceptedContacts => {
2350- is_chat_message || is_reply_to_chat_message || accepted_contact
2351- }
2352- ShowEmails :: All => true ,
2353- } ;
2354-
2355- let should_download = ( show && !blocked_contact) || maybe_ndn;
2332+ let should_download = !blocked_contact || maybe_ndn;
23562333 Ok ( should_download)
23572334}
23582335
0 commit comments