From 061fd1dd2d3626c4ccb3854324224a6b195f2551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kl=C3=A4hn?= Date: Mon, 30 Jan 2023 12:30:51 +0100 Subject: [PATCH] move function to better place --- src/receive_imf.rs | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/receive_imf.rs b/src/receive_imf.rs index e821adb8c..134885778 100644 --- a/src/receive_imf.rs +++ b/src/receive_imf.rs @@ -604,16 +604,6 @@ async fn add_parts( } } } - - better_msg = better_msg.or(apply_group_changes( - context, - mime_parser, - sent_timestamp, - chat_id, - from_id, - to_ids, - ) - .await?); } if chat_id.is_none() { @@ -659,6 +649,21 @@ async fn add_parts( apply_mailinglist_changes(context, mime_parser, chat_id).await?; } + if let Some(chat_id) = chat_id { + if let Some(even_better_msg) = apply_group_changes( + context, + mime_parser, + sent_timestamp, + chat_id, + from_id, + to_ids, + ) + .await? + { + better_msg = Some(even_better_msg) + } + } + // if contact renaming is prevented (for mailinglists and bots), // we use name from From:-header as override name if prevent_rename {