From c2b31ed7c96c796eb3fd02da23015029388067d4 Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Wed, 18 Dec 2019 06:34:03 +0100 Subject: copy: adapt to ProvidesMessages --- commands/msg/copy.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'commands/msg') 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") + h := newHelper(aerc) + uids, err := h.uids() + if err != nil { + return err } - msg, err := widget.SelectedMessage() + store, err := h.store() if err != nil { return err } - store.Copy([]uint32{msg.Uid}, strings.Join(args[optind:], " "), + store.Copy(uids, strings.Join(args[optind:], " "), createParents, func( msg types.WorkerMessage) { -- cgit v1.2.3