2019-08-01 18:29:21 +00:00
|
|
|
package compose
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"git.sr.ht/~sircmpwn/aerc/widgets"
|
|
|
|
)
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
composer, _ := aerc.SelectedTab().(*widgets.Composer)
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|