From d238272bdbbe5f417c3ec07e5ce39a77a9a97bd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leszek=20Cima=C5=82a?= Date: Wed, 8 Jan 2020 21:44:16 +0100 Subject: add .OriginalMIMEType variable to reply template --- commands/msg/reply.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'commands') diff --git a/commands/msg/reply.go b/commands/msg/reply.go index 2964a83..3c69e27 100644 --- a/commands/msg/reply.go +++ b/commands/msg/reply.go @@ -157,6 +157,17 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error { buf := new(bytes.Buffer) buf.ReadFrom(reader) original.Text = buf.String() + if len(msg.BodyStructure.Parts) == 0 { + original.MIMEType = fmt.Sprintf("%s/%s", + msg.BodyStructure.MIMEType, msg.BodyStructure.MIMESubType) + } else { + // TODO: still will be "multipart/mixed" for mixed mails with + // attachments, fix this after aerc could handle responding to + // such mails + original.MIMEType = fmt.Sprintf("%s/%s", + msg.BodyStructure.Parts[0].MIMEType, + msg.BodyStructure.Parts[0].MIMESubType) + } addTab() }) return nil -- cgit v1.2.3