1
0
mirror of https://git.sr.ht/~sircmpwn/aerc synced 2024-11-24 00:52:29 +01:00

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 <kkuehler@brave.com>
This commit is contained in:
Kevin Kuehler 2019-06-10 22:27:54 -07:00 committed by Drew DeVault
parent d22a9140cd
commit d1df710328

@ -26,12 +26,13 @@ func Archive(aerc *widgets.Aerc, args []string) error {
if len(args) != 2 {
return errors.New("Usage: archive <flat|year|month>")
}
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()