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