forward: remove crlf in text body

Remove crlf from the text body when forwarding a message.

Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Tim Culverhouse <tim@timculverhouse.com>
This commit is contained in:
Koni Marti 2022-06-28 23:42:09 +02:00 committed by Robin Jarry
parent 60052c6070
commit c04446327e
1 changed files with 5 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package msg
import (
"bufio"
"bytes"
"errors"
"fmt"
@ -164,7 +165,10 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error {
}
store.FetchBodyPart(msg.Uid, part, func(reader io.Reader) {
buf := new(bytes.Buffer)
buf.ReadFrom(reader)
scanner := bufio.NewScanner(reader)
for scanner.Scan() {
buf.WriteString(scanner.Text() + "\n")
}
original.Text = buf.String()
// create composer