From f92935c9c395ce4ee38fdc734c7ba93133a369e8 Mon Sep 17 00:00:00 2001 From: Sebastien Binet Date: Thu, 14 Dec 2023 16:20:37 +0100 Subject: commands/msg: adapt quote-reply to honor viewer::alternatives modify quote-reply to quote the message part corresponding to the first MIME type matching the list in viewer::alternatives. Signed-off-by: Sebastien Binet Acked-by: Robin Jarry --- commands/msg/reply.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/commands/msg/reply.go b/commands/msg/reply.go index 699c75fb..4b3e7c81 100644 --- a/commands/msg/reply.go +++ b/commands/msg/reply.go @@ -222,7 +222,14 @@ func (r reply) Execute(args []string) error { return nil } - part := lib.FindPlaintext(msg.BodyStructure, nil) + var part []int + for _, mime := range config.Viewer.Alternatives { + part = lib.FindMIMEPart(mime, msg.BodyStructure, nil) + if part != nil { + break + } + } + if part == nil { // mkey... let's get the first thing that isn't a container // if that's still nil it's either not a multipart msg (ok) or -- cgit