copy: adapt to ProvidesMessages
This commit is contained in:
parent
884784ac32
commit
c2b31ed7c9
|
@ -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) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue