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:
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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user