aboutsummaryrefslogtreecommitdiffstats
path: root/commands/msgview
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2022-06-25 07:40:10 -0500
committerRobin Jarry <robin@jarry.cc>2022-06-26 12:07:44 +0200
commit96db50c4f06bab4ef052b584943d8c7113766a06 (patch)
tree9685c9e2576d51d9fd4fb62a29b92f61407d77a1 /commands/msgview
parent520595114963e5251bf7d26d5056230cdce7ec98 (diff)
downloadaerc-96db50c4f06bab4ef052b584943d8c7113766a06.tar.gz
open: fix mimetype discovery for encrypted or signed messages
Mimetype discovery for the :open command is based on the BodyStructure of the message. This patch fixes the method which got the BodyStructure of the message to a more generalized one, which is set post-encryption and post-validation. This allows encrypted or signed message parts to have their proper mimetype discovered. Fixes: https://todo.sr.ht/~rjarry/aerc/50 Reported-by: ~ph14nix Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Koni Marti <koni.marti@gmail.com>
Diffstat (limited to 'commands/msgview')
-rw-r--r--commands/msgview/open.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/msgview/open.go b/commands/msgview/open.go
index c2761729..7615e9a8 100644
--- a/commands/msgview/open.go
+++ b/commands/msgview/open.go
@@ -52,7 +52,7 @@ func (Open) Execute(aerc *widgets.Aerc, args []string) error {
mv.MessageView().FetchBodyPart(p.Index, func(reader io.Reader) {
extension := ""
// try to determine the correct extension based on mimetype
- if part, err := p.Msg.BodyStructure.PartAtIndex(p.Index); err == nil {
+ if part, err := mv.MessageView().BodyStructure().PartAtIndex(p.Index); err == nil {
mimeType := fmt.Sprintf("%s/%s", part.MIMEType, part.MIMESubType)
if exts, _ := mime.ExtensionsByType(mimeType); len(exts) > 0 {