aboutsummaryrefslogtreecommitdiffstats
path: root/commands/msg/reply.go
diff options
context:
space:
mode:
authorJeffas <dev@jeffas.io>2019-09-07 19:34:07 +0100
committerDrew DeVault <sir@cmpwn.com>2019-09-11 12:11:27 -0400
commit3c3bc517b5d0a860c03c9c5a701f733bd4bf4e4d (patch)
tree85e39c576624c9afc9f0616bae70bc6cb1a8fa06 /commands/msg/reply.go
parentf6216bb6213a15cdcdf50089f3c4a8e9a30d9337 (diff)
downloadaerc-3c3bc517b5d0a860c03c9c5a701f733bd4bf4e4d.tar.gz
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.
Diffstat (limited to 'commands/msg/reply.go')
-rw-r--r--commands/msg/reply.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/commands/msg/reply.go b/commands/msg/reply.go
index 34d03d53..813a66e5 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
}