diff options
author | Koni Marti <koni.marti@gmail.com> | 2022-10-23 21:27:06 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-11-09 21:14:24 +0100 |
commit | 0f78cb2ea97ca501b6eb0d659f883197753ee075 (patch) | |
tree | 54f3d2d3a2837b414c59b534d2992a1450dddbff /commands | |
parent | 9921b33679f6b0c9d2a609fe3112178ec40b8dd2 (diff) | |
download | aerc-0f78cb2ea97ca501b6eb0d659f883197753ee075.tar.gz |
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 <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands')
-rw-r--r-- | commands/msg/pipe.go | 16 | ||||
-rw-r--r-- | commands/msgview/next.go | 4 |
2 files changed, 19 insertions, 1 deletions
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 } diff --git a/commands/msgview/next.go b/commands/msgview/next.go index 5df7847d..a32e358f 100644 --- a/commands/msgview/next.go +++ b/commands/msgview/next.go @@ -2,6 +2,7 @@ package msgview import ( "errors" + "fmt" "git.sr.ht/~rjarry/aerc/commands/account" "git.sr.ht/~rjarry/aerc/lib" @@ -35,6 +36,9 @@ func (NextPrevMsg) Execute(aerc *widgets.Aerc, args []string) error { return errors.New("No account selected") } store := mv.Store() + if store == nil { + return fmt.Errorf("Cannot perform action. No message store set.") + } err = account.ExecuteNextPrevMessage(args, acct, pct, n) if err != nil { return err |