From 0f78cb2ea97ca501b6eb0d659f883197753ee075 Mon Sep 17 00:00:00 2001 From: Koni Marti Date: Sun, 23 Oct 2022 21:27:06 +0200 Subject: lib: implement an eml message view Implement a MessageView representation for eml data that are not stored in a message store. With this, we can display any rfc822 message data in the message viewer. Signed-off-by: Koni Marti Acked-by: Robin Jarry --- commands/msg/pipe.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'commands/msg/pipe.go') diff --git a/commands/msg/pipe.go b/commands/msg/pipe.go index d0101675..4a5a6168 100644 --- a/commands/msg/pipe.go +++ b/commands/msg/pipe.go @@ -123,6 +123,18 @@ func (Pipe) Execute(aerc *widgets.Aerc, args []string) error { h := newHelper(aerc) store, err := h.store() if err != nil { + if mv, ok := provider.(*widgets.MessageViewer); ok { + mv.MessageView().FetchFull(func(reader io.Reader) { + if background { + doExec(reader) + } else { + doTerm(reader, + fmt.Sprintf("%s <%s", + cmd[0], title)) + } + }) + return nil + } return err } uids, err = h.markedOrSelectedUids() @@ -215,7 +227,9 @@ func (Pipe) Execute(aerc *widgets.Aerc, args []string) error { } }) } - provider.Store().Marker().ClearVisualMark() + if store := provider.Store(); store != nil { + store.Marker().ClearVisualMark() + } return nil } -- cgit