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 createParents = true
} }
} }
h := newHelper(aerc)
widget := aerc.SelectedTab().(widgets.ProvidesMessage) uids, err := h.uids()
store := widget.Store()
if store == nil {
return errors.New("Cannot perform action. Messages still loading")
}
msg, err := widget.SelectedMessage()
if err != nil { if err != nil {
return err 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( createParents, func(
msg types.WorkerMessage) { msg types.WorkerMessage) {