From d1df7103280ef488434b103e5e9e3129c407e5b6 Mon Sep 17 00:00:00 2001 From: Kevin Kuehler Date: Mon, 10 Jun 2019 22:27:54 -0700 Subject: commands/msg/archive: Work with msgviwer Inside the generic msg command we cannot use aerc.SelectedAccount() because the method naively assumes the current tab is an AccountView. Use the ProvidesMessage interface instead. Signed-off-by: Kevin Kuehler --- commands/msg/archive.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'commands/msg/archive.go') diff --git a/commands/msg/archive.go b/commands/msg/archive.go index 11752f7d..da4c421c 100644 --- a/commands/msg/archive.go +++ b/commands/msg/archive.go @@ -26,12 +26,13 @@ func Archive(aerc *widgets.Aerc, args []string) error { if len(args) != 2 { return errors.New("Usage: archive ") } - acct := aerc.SelectedAccount() + widget := aerc.SelectedTab().(widgets.ProvidesMessage) + acct := widget.SelectedAccount() if acct == nil { return errors.New("No account selected") } - msg := acct.Messages().Selected() - store := acct.Messages().Store() + msg := widget.SelectedMessage() + store := widget.Store() archiveDir := acct.AccountConfig().Archive acct.Messages().Next() -- cgit