From 46d6b810588c09fcc65ba27647a0e7f858f3bfc7 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sun, 19 May 2024 21:44:51 +0000 Subject: [PATCH] refactor(receive_imf): do not check for ContactId::UNDEFINED from_id should not be undefined, we either should create a contact for it by then or reject the message. --- src/receive_imf.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/receive_imf.rs b/src/receive_imf.rs index 4a7cb8967..71e3e6854 100644 --- a/src/receive_imf.rs +++ b/src/receive_imf.rs @@ -769,11 +769,7 @@ async fn add_parts( if mime_parser.incoming { to_id = ContactId::SELF; - let test_normal_chat = if from_id == ContactId::UNDEFINED { - None - } else { - ChatIdBlocked::lookup_by_contact(context, from_id).await? - }; + let test_normal_chat = ChatIdBlocked::lookup_by_contact(context, from_id).await?; if chat_id.is_none() && mime_parser.delivery_report.is_some() { chat_id = Some(DC_CHAT_ID_TRASH);