aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/compose.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/widgets/compose.go b/widgets/compose.go
index dc4719a6..74493ac9 100644
--- a/widgets/compose.go
+++ b/widgets/compose.go
@@ -1511,6 +1511,8 @@ func (c *Composer) checkEncryptionKeys(_ string) bool {
mk = append(mk, rcpt)
}
}
+
+ encrypt := true
switch {
case len(mk) > 0:
c.SetEncrypt(false)
@@ -1527,13 +1529,14 @@ func (c *Composer) checkEncryptionKeys(_ string) bool {
}
}
c.aerc.statusline.PushError(st)
- return false
+ encrypt = false
case len(rcpts) == 0:
- return false
+ encrypt = false
}
+
// If callbacks were registered, encrypt will be set when user removes
// recipients with missing keys
- c.encrypt = true
+ c.encrypt = encrypt
err = c.updateCrypto()
if err != nil {
log.Warnf("failed update crypto: %v", err)