2021-12-30 10:25:09 +01: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 12:54:55 +02:00
|
|
|
composer, _ := aerc.SelectedTabContent().(*widgets.Composer)
|
2021-12-30 10:25:09 +01:00
|
|
|
|
|
|
|
composer.SetEncrypt(!composer.Encrypt())
|
|
|
|
return nil
|
|
|
|
}
|