2021-12-30 09:25:09 +00:00
|
|
|
package compose
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
"git.sr.ht/~rjarry/aerc/widgets"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Encrypt struct{}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
register(Encrypt{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (Encrypt) Aliases() []string {
|
|
|
|
return []string{"encrypt"}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (Encrypt) Complete(aerc *widgets.Aerc, args []string) []string {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (Encrypt) Execute(aerc *widgets.Aerc, args []string) error {
|
|
|
|
if len(args) != 1 {
|
|
|
|
return errors.New("Usage: encrypt")
|
|
|
|
}
|
|
|
|
|
2022-07-18 10:54:55 +00:00
|
|
|
composer, _ := aerc.SelectedTabContent().(*widgets.Composer)
|
2021-12-30 09:25:09 +00:00
|
|
|
|
|
|
|
composer.SetEncrypt(!composer.Encrypt())
|
|
|
|
return nil
|
|
|
|
}
|