From c2b31ed7c96c796eb3fd02da23015029388067d4 Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Wed, 18 Dec 2019 06:34:03 +0100 Subject: [PATCH] copy: adapt to ProvidesMessages --- commands/msg/copy.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/commands/msg/copy.go b/commands/msg/copy.go index 48b296c..30022f1 100644 --- a/commands/msg/copy.go +++ b/commands/msg/copy.go @@ -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) {