summaryrefslogtreecommitdiff
path: root/commands/msgview/open.go
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2022-06-23 11:26:19 -0500
committerRobin Jarry <robin@jarry.cc>2022-06-24 21:08:21 +0200
commit8f9bb2b289af34581b43e0777b2376ab0617aecd (patch)
treead89fdf43896e34fec883d16bcae7bd61a8f1049 /commands/msgview/open.go
parente9b01867827aac29f11b376debaf2209e8e7c9b4 (diff)
downloadaerc-8f9bb2b289af34581b43e0777b2376ab0617aecd.zip
pgp: fix pipe|open|save command behavior
Signed and/or encrypted PGP messages did not behave properly for pipe, open, and save commands. Specifically, the proper Message Part would not be passed to the command in the MessageViewer. This is due to the encapsulation of the body structure. This patch fixes the behavior for piping|opening|saving of message parts. Fixes: https://todo.sr.ht/~rjarry/aerc/47 Reported-by: ~ph14nix Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands/msgview/open.go')
-rw-r--r--commands/msgview/open.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/commands/msgview/open.go b/commands/msgview/open.go
index 3d62fe2..c276172 100644
--- a/commands/msgview/open.go
+++ b/commands/msgview/open.go
@@ -49,8 +49,7 @@ func (Open) Execute(aerc *widgets.Aerc, args []string) error {
return nil
}
- store := mv.Store()
- store.FetchBodyPart(p.Msg.Uid, p.Index, func(reader io.Reader) {
+ 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 {