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
|
@ -26,12 +26,13 @@ func Archive(aerc *widgets.Aerc, args []string) error {
|
||||||
if len(args) != 2 {
|
if len(args) != 2 {
|
||||||
return errors.New("Usage: archive <flat|year|month>")
|
return errors.New("Usage: archive <flat|year|month>")
|
||||||
}
|
}
|
||||||
acct := aerc.SelectedAccount()
|
widget := aerc.SelectedTab().(widgets.ProvidesMessage)
|
||||||
|
acct := widget.SelectedAccount()
|
||||||
if acct == nil {
|
if acct == nil {
|
||||||
return errors.New("No account selected")
|
return errors.New("No account selected")
|
||||||
}
|
}
|
||||||
msg := acct.Messages().Selected()
|
msg := widget.SelectedMessage()
|
||||||
store := acct.Messages().Store()
|
store := widget.Store()
|
||||||
archiveDir := acct.AccountConfig().Archive
|
archiveDir := acct.AccountConfig().Archive
|
||||||
acct.Messages().Next()
|
acct.Messages().Next()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue