diff options
author | 2024-02-03 10:52:45 +0100 | |
---|---|---|
committer | 2024-02-03 21:52:58 +0100 | |
commit | 0a2ff6a630eb42b7c2491d639ff2e495524577f0 (patch) | |
tree | 6e4c4c096fbd61b3de41edefb059adced643638b /plugins/base/strconv.go | |
parent | adcb58e49563a9b0ab791ca4249d8201b215a8db (diff) | |
download | alps-0a2ff6a630eb42b7c2491d639ff2e495524577f0.tar.gz alps-0a2ff6a630eb42b7c2491d639ff2e495524577f0.tar.bz2 alps-0a2ff6a630eb42b7c2491d639ff2e495524577f0.zip |
Add optional Cc and Bcc fields when composing a message
This should address https://todo.sr.ht/~migadu/alps/145.
Diffstat (limited to 'plugins/base/strconv.go')
-rw-r--r-- | plugins/base/strconv.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/base/strconv.go b/plugins/base/strconv.go index 4266e00..4868d71 100644 --- a/plugins/base/strconv.go +++ b/plugins/base/strconv.go @@ -64,8 +64,14 @@ func parsePartPath(s string) ([]int, error) { func parseAddressList(s string) []string { l := strings.Split(s, ",") - for i, addr := range l { - l[i] = strings.TrimSpace(addr) + ret := make([]string, 0, len(l)) + for _, addr := range l { + if addr == "" { + continue + } + + ret = append(ret, strings.TrimSpace(addr)) } - return l + + return ret } |