From 3c3bc517b5d0a860c03c9c5a701f733bd4bf4e4d Mon Sep 17 00:00:00 2001 From: Jeffas Date: Sat, 7 Sep 2019 19:34:07 +0100 Subject: Ensure mimetype parts are converted to lower case This ensures that the check for a text message to use in the reply is performed (more) correctly and so uses the plaintext more often. --- commands/msg/reply.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'commands/msg/reply.go') diff --git a/commands/msg/reply.go b/commands/msg/reply.go index 34d03d5..813a66e 100644 --- a/commands/msg/reply.go +++ b/commands/msg/reply.go @@ -194,10 +194,11 @@ func findPlaintext(bs *models.BodyStructure, for i, part := range bs.Parts { cur := append(path, i+1) - if part.MIMEType == "text" && part.MIMESubType == "plain" { + if strings.ToLower(part.MIMEType) == "text" && + strings.ToLower(part.MIMESubType) == "plain" { return part, cur } - if part.MIMEType == "multipart" { + if strings.ToLower(part.MIMEType) == "multipart" { if part, path := findPlaintext(part, cur); path != nil { return part, path } -- cgit 1.4.1-2-gfad0