copy: adapt to ProvidesMessages

This commit is contained in:
Reto Brunner 2019-12-18 06:34:03 +01:00 committed by Drew DeVault
parent 884784ac32
commit c2b31ed7c9
1 changed files with 7 additions and 8 deletions

View File

@ -44,17 +44,16 @@ func (Copy) Execute(aerc *widgets.Aerc, args []string) error {
createParents = true
}
}
widget := aerc.SelectedTab().(widgets.ProvidesMessage)
store := widget.Store()
if store == nil {
return errors.New("Cannot perform action. Messages still loading")
}
msg, err := widget.SelectedMessage()
h := newHelper(aerc)
uids, err := h.uids()
if err != nil {
return err
}
store.Copy([]uint32{msg.Uid}, strings.Join(args[optind:], " "),
store, err := h.store()
if err != nil {
return err
}
store.Copy(uids, strings.Join(args[optind:], " "),
createParents, func(
msg types.WorkerMessage) {