diff options
author | Koni Marti <koni.marti@gmail.com> | 2024-01-18 11:38:26 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2024-01-20 00:33:08 +0100 |
commit | d2817371867e94b621de4054b235d53312db8073 (patch) | |
tree | dada7a3065b3b52a7ccd9d9a62f1803e9796eacb | |
parent | 635f1fb49920e807c38f7a61c062c48879634c6c (diff) | |
download | aerc-d2817371867e94b621de4054b235d53312db8073.tar.gz |
envelope: use message from current tab
Use the message from the current tab to populate the :envelope window.
Fixes: https://todo.sr.ht/~rjarry/aerc/213
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
-rw-r--r-- | commands/msg/envelope.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/commands/msg/envelope.go b/commands/msg/envelope.go index e104648d..62a266b0 100644 --- a/commands/msg/envelope.go +++ b/commands/msg/envelope.go @@ -26,13 +26,18 @@ func (Envelope) Aliases() []string { } func (e Envelope) Execute(args []string) error { - acct := app.SelectedAccount() + provider, ok := app.SelectedTabContent().(app.ProvidesMessages) + if !ok { + return fmt.Errorf("current tab does not implement app.ProvidesMessage interface") + } + + acct := provider.SelectedAccount() if acct == nil { return errors.New("No account selected") } var list []string - if msg, err := acct.SelectedMessage(); err != nil { + if msg, err := provider.SelectedMessage(); err != nil { return err } else { if msg != nil { |