2019-08-01 18:29:21 +00:00
|
|
|
package compose
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
|
2021-11-05 09:19:46 +00:00
|
|
|
"git.sr.ht/~rjarry/aerc/widgets"
|
2019-08-01 18:29:21 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type CC struct{}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
register(CC{})
|
|
|
|
}
|
|
|
|
|
2019-09-03 19:34:03 +00:00
|
|
|
func (CC) Aliases() []string {
|
2019-08-01 18:29:21 +00:00
|
|
|
return []string{"cc", "bcc"}
|
|
|
|
}
|
|
|
|
|
2019-09-03 19:34:03 +00:00
|
|
|
func (CC) Complete(aerc *widgets.Aerc, args []string) []string {
|
2019-08-01 18:29:21 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-09-03 19:34:03 +00:00
|
|
|
func (CC) Execute(aerc *widgets.Aerc, args []string) error {
|
2019-08-04 04:09:13 +00:00
|
|
|
var addrs string
|
|
|
|
if len(args) > 1 {
|
|
|
|
addrs = strings.Join(args[1:], " ")
|
2019-08-01 18:29:21 +00:00
|
|
|
}
|
2022-07-18 10:54:55 +00:00
|
|
|
composer, _ := aerc.SelectedTabContent().(*widgets.Composer)
|
2019-08-01 18:29:21 +00:00
|
|
|
|
|
|
|
switch args[0] {
|
|
|
|
case "cc":
|
2019-08-04 00:23:08 +00:00
|
|
|
composer.AddEditor("Cc", addrs, true)
|
2019-08-01 18:29:21 +00:00
|
|
|
case "bcc":
|
2019-08-04 00:23:08 +00:00
|
|
|
composer.AddEditor("Bcc", addrs, true)
|
2019-08-01 18:29:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|