melib: add "On ${date} ${author} wrote" heading in replies

jmap
Manos Pitsidianakis 2019-11-16 19:59:47 +02:00
parent bd4cf860fa
commit 04e1137b36
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 6 additions and 3 deletions

View File

@ -175,11 +175,14 @@ impl Draft {
let reply_body_bytes = decode_rec(&body, None);
let reply_body = String::from_utf8_lossy(&reply_body_bytes);
let lines: Vec<&str> = reply_body.lines().collect();
let mut ret = String::with_capacity(reply_body.len() + lines.len());
let mut ret = format!(
"On {} {} wrote:\n",
envelope.date_as_str(),
ret.headers()["To"]
);
for l in lines {
ret.push('>');
ret.push(' ');
ret.push_str(l.trim());
ret.push_str(l);
ret.push('\n');
}
ret.pop();