melib: add "On ${date} ${author} wrote" heading in replies
parent
bd4cf860fa
commit
04e1137b36
|
@ -175,11 +175,14 @@ impl Draft {
|
||||||
let reply_body_bytes = decode_rec(&body, None);
|
let reply_body_bytes = decode_rec(&body, None);
|
||||||
let reply_body = String::from_utf8_lossy(&reply_body_bytes);
|
let reply_body = String::from_utf8_lossy(&reply_body_bytes);
|
||||||
let lines: Vec<&str> = reply_body.lines().collect();
|
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 {
|
for l in lines {
|
||||||
ret.push('>');
|
ret.push('>');
|
||||||
ret.push(' ');
|
ret.push_str(l);
|
||||||
ret.push_str(l.trim());
|
|
||||||
ret.push('\n');
|
ret.push('\n');
|
||||||
}
|
}
|
||||||
ret.pop();
|
ret.pop();
|
||||||
|
|
Loading…
Reference in New Issue