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:
parent
d22a9140cd
commit
d1df710328
1 changed files with 4 additions and 3 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue