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