diff options
author | Reto Brunner <reto@labrat.space> | 2019-12-18 06:34:03 +0100 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-12-21 09:27:51 -0500 |
commit | c2b31ed7c96c796eb3fd02da23015029388067d4 (patch) | |
tree | 27b63b1c23744087f1d4dd9a98fd300fd6c591af /commands | |
parent | 884784ac3235f84aa3717c3c214fc5f310fde399 (diff) | |
download | aerc-c2b31ed7c96c796eb3fd02da23015029388067d4.tar.gz |
copy: adapt to ProvidesMessages
Diffstat (limited to 'commands')
-rw-r--r-- | commands/msg/copy.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/commands/msg/copy.go b/commands/msg/copy.go index 48b296c4..30022f18 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) { |