summary refs log tree commit diff stats
path: root/commands/msg
diff options
context:
space:
mode:
Diffstat (limited to 'commands/msg')
-rw-r--r--commands/msg/copy.go13
1 files changed, 6 insertions, 7 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")
+	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) {