diff options
author | Koni Marti <koni.marti@gmail.com> | 2022-07-07 17:43:29 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-07-10 20:40:39 +0200 |
commit | aae46c7afdf4f64a49384afde41984edf936da76 (patch) | |
tree | d2c7c412b4e42a3de6893721d5bef9731fc8be92 /widgets/compose.go | |
parent | 635530b12d46ff29555ba322a6bfd3c5bf8f4e7a (diff) | |
download | aerc-aae46c7afdf4f64a49384afde41984edf936da76.tar.gz |
composer: remove header if empty
Remove a header when it is empty.
Commit a253e89bdae6 ("compose: prevent sending empty address list
headers") tried to avoid sending empty headers; but instead of deleting
the header, the empty string value was just ignored.
Fixes: https://todo.sr.ht/~rjarry/aerc/55
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
Diffstat (limited to 'widgets/compose.go')
-rw-r--r-- | widgets/compose.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/widgets/compose.go b/widgets/compose.go index da2bde33..2516c48a 100644 --- a/widgets/compose.go +++ b/widgets/compose.go @@ -974,7 +974,8 @@ func (he *headerEditor) storeValue() { switch strings.ToLower(he.name) { case "to", "from", "cc", "bcc": if strings.TrimSpace(val) == "" { - // Don't set empty address list headers + // if header is empty, delete it + he.header.Del(he.name) return } list, err := mail.ParseAddressList(val) |