aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2022-03-17 19:36:19 -0500
committerRobin Jarry <robin@jarry.cc>2022-03-18 09:15:48 +0100
commit62a5ebb1e19aeb36f8451510bc03d5dbe986fb04 (patch)
tree2cf88d908e1b185a2dfb797cdadc1ca7dece2d74
parenta0fceb80b3ac036326a3af20eb2a05bbe215be64 (diff)
downloadaerc-62a5ebb1e19aeb36f8451510bc03d5dbe986fb04.tar.gz
mailto: allow empty recipient field
Allow a mailto link to open a new composer even if no recipient is in the url. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Moritz Poldrack <git@moritz.sh>
-rw-r--r--widgets/aerc.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/widgets/aerc.go b/widgets/aerc.go
index cfc42919..5dda8882 100644
--- a/widgets/aerc.go
+++ b/widgets/aerc.go
@@ -527,7 +527,7 @@ func (aerc *Aerc) Mailto(addr *url.URL) error {
var subject string
h := &mail.Header{}
to, err := mail.ParseAddressList(addr.Opaque)
- if err != nil {
+ if err != nil && addr.Opaque != "" {
return fmt.Errorf("Could not parse to: %v", err)
}
h.SetAddressList("to", to)
@@ -567,6 +567,9 @@ func (aerc *Aerc) Mailto(addr *url.URL) error {
title = subject
composer.FocusTerminal()
}
+ if to == nil {
+ composer.FocusRecipient()
+ }
tab := aerc.NewTab(composer, title)
composer.OnHeaderChange("Subject", func(subject string) {
if subject == "" {