@@ -491,7 +491,8 @@ pub(crate) async fn receive_imf_inner(
491
491
} else if let Some ( parent) = & parent_message {
492
492
if let Some ( ( chat_id, chat_id_blocked) ) =
493
493
// Try to assign to a chat based on In-Reply-To/References.
494
- lookup_chat_by_reply ( context, & mime_parser, parent) . await ?
494
+ lookup_chat_by_reply ( context, & mime_parser, parent, & is_partial_download)
495
+ . await ?
495
496
{
496
497
// Try to assign to a chat based on In-Reply-To/References.
497
498
ChatAssignment :: ExistingChat {
@@ -517,7 +518,7 @@ pub(crate) async fn receive_imf_inner(
517
518
} else if let Some ( parent) = & parent_message {
518
519
if let Some ( ( chat_id, chat_id_blocked) ) =
519
520
// Try to assign to a chat based on In-Reply-To/References.
520
- lookup_chat_by_reply ( context, & mime_parser, parent) . await ?
521
+ lookup_chat_by_reply ( context, & mime_parser, parent, & is_partial_download ) . await ?
521
522
{
522
523
// Try to assign to a chat based on In-Reply-To/References.
523
524
ChatAssignment :: ExistingChat {
@@ -2277,6 +2278,7 @@ async fn lookup_chat_by_reply(
2277
2278
context : & Context ,
2278
2279
mime_parser : & MimeMessage ,
2279
2280
parent : & Message ,
2281
+ is_partial_download : & Option < u32 > ,
2280
2282
) -> Result < Option < ( ChatId , Blocked ) > > {
2281
2283
debug_assert ! ( mime_parser. get_chat_group_id( ) . is_none( ) ) ;
2282
2284
@@ -2300,7 +2302,10 @@ async fn lookup_chat_by_reply(
2300
2302
}
2301
2303
2302
2304
// Do not assign unencrypted messages to encrypted chats.
2303
- if parent_chat. is_encrypted ( context) . await ? && !mime_parser. was_encrypted ( ) {
2305
+ if is_partial_download. is_none ( )
2306
+ && parent_chat. is_encrypted ( context) . await ?
2307
+ && !mime_parser. was_encrypted ( )
2308
+ {
2304
2309
return Ok ( None ) ;
2305
2310
}
2306
2311
0 commit comments