| 1 |
package compose |
| 2 |
|
| 3 |
import ( |
| 4 |
"git.sr.ht/~rjarry/aerc/app" |
| 5 |
"git.sr.ht/~rjarry/aerc/commands" |
| 6 |
) |
| 7 |
|
| 8 |
type AttachKey struct{} |
| 9 |
|
| 10 |
func init() { |
| 11 |
commands.Register(AttachKey{}) |
| 12 |
} |
| 13 |
|
| 14 |
func (AttachKey) Description() string { |
| 15 |
return "Attach the public key of the current account." |
| 16 |
} |
| 17 |
|
| 18 |
func (AttachKey) Context() commands.CommandContext { |
| 19 |
return commands.COMPOSE_EDIT | commands.COMPOSE_REVIEW |
| 20 |
} |
| 21 |
|
| 22 |
func (AttachKey) Aliases() []string { |
| 23 |
return []string{"attach-key"} |
| 24 |
} |
| 25 |
|
| 26 |
func (AttachKey) Execute(args []string) error { |
| 27 |
composer, _ := app.SelectedTabContent().(*app.Composer) |
| 28 |
return composer.SetAttachKey(!composer.AttachKey()) |
| 29 |
} |