diff options
Diffstat (limited to 'commands/compose/cc-bcc.go')
-rw-r--r-- | commands/compose/cc-bcc.go | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/commands/compose/cc-bcc.go b/commands/compose/cc-bcc.go index e1f94c1e..aeb6af97 100644 --- a/commands/compose/cc-bcc.go +++ b/commands/compose/cc-bcc.go @@ -1,12 +1,12 @@ package compose import ( - "strings" - "git.sr.ht/~rjarry/aerc/app" ) -type CC struct{} +type CC struct { + Recipients string `opt:"recipients"` +} func init() { register(CC{}) @@ -20,18 +20,14 @@ func (CC) Complete(args []string) []string { return nil } -func (CC) Execute(args []string) error { - var addrs string - if len(args) > 1 { - addrs = strings.Join(args[1:], " ") - } +func (c CC) Execute(args []string) error { composer, _ := app.SelectedTabContent().(*app.Composer) switch args[0] { case "cc": - return composer.AddEditor("Cc", addrs, true) + return composer.AddEditor("Cc", c.Recipients, true) case "bcc": - return composer.AddEditor("Bcc", addrs, true) + return composer.AddEditor("Bcc", c.Recipients, true) } return nil |