From a70631de1c7b40bf292edd3040d0c5ed43bc3123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Wed, 4 Aug 2021 16:50:16 +0200 Subject: [PATCH] add missing subject prefix for replies --- src/msg/model.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/msg/model.rs b/src/msg/model.rs index ea1680f..8eb1fd7 100644 --- a/src/msg/model.rs +++ b/src/msg/model.rs @@ -293,7 +293,8 @@ impl<'m> Msg<'m> { "in-reply-to" => msg.in_reply_to(value.parse().unwrap()), "from" => match value.parse::() { Ok(addr) => { - let msg_id = format!("{}@{}", Uuid::new_v4().to_string(), addr.email.domain()); + let msg_id = + format!("{}@{}", Uuid::new_v4().to_string(), addr.email.domain()); msg.from(addr).message_id(Some(msg_id)) } Err(_) => msg, @@ -435,7 +436,9 @@ impl<'m> Msg<'m> { in_reply_to: headers.get_first_value("message-id"), to, cc: None, - subject: headers.get_first_value("subject"), + subject: headers + .get_first_value("subject") + .map(|s| format!("Re: {}", s)), default_content: Some(thread), }; Msg::build_tpl(config, account, msg_spec) @@ -503,7 +506,9 @@ impl<'m> Msg<'m> { in_reply_to: headers.get_first_value("message-id"), cc, to: Some(vec![reply_to, to].concat()), - subject: headers.get_first_value("subject"), + subject: headers + .get_first_value("subject") + .map(|s| format!("Re: {}", s)), default_content: Some(thread), }; Msg::build_tpl(config, account, msg_spec)