Debian Codegraph @

commands/compose/encrypt.go

raw
1 package compose
2
3 import (
4 "git.sr.ht/~rjarry/aerc/app"
5 "git.sr.ht/~rjarry/aerc/commands"
6 )
7
8 type Encrypt struct{}
9
10 func init() {
11 commands.Register(Encrypt{})
12 }
13
14 func (Encrypt) Description() string {
15 return "Toggle encryption of the message to all recipients."
16 }
17
18 func (Encrypt) Context() commands.CommandContext {
19 return commands.COMPOSE_EDIT | commands.COMPOSE_REVIEW
20 }
21
22 func (Encrypt) Aliases() []string {
23 return []string{"encrypt"}
24 }
25
26 func (Encrypt) Execute(args []string) error {
27 composer, _ := app.SelectedTabContent().(*app.Composer)
28 composer.SetEncrypt(!composer.Encrypt())
29 return nil
30 }