diff options
author | Robin Jarry <robin@jarry.cc> | 2023-02-12 01:27:28 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-02-20 14:44:32 +0100 |
commit | a5df5c30b62aae0b2f9d54e6f40fab76999c565b (patch) | |
tree | 98dfe25d94ec02e3c23853afc0ace09a1a39b27c /lib/templates/functions.go | |
parent | 9fa296fb762231d386db88913d1c2ea521bd813c (diff) | |
download | aerc-a5df5c30b62aae0b2f9d54e6f40fab76999c565b.tar.gz |
templates: fix mboxes function
mboxes currently returns the same value that emails. The SplitN API is
misleading, to actually split something, the N value must be greater
than 1...
Fixes: d758441fe0c4 ("templates: add more fields and functions")
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
Diffstat (limited to 'lib/templates/functions.go')
-rw-r--r-- | lib/templates/functions.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/templates/functions.go b/lib/templates/functions.go index 37b014f5..ec11c1c7 100644 --- a/lib/templates/functions.go +++ b/lib/templates/functions.go @@ -145,7 +145,7 @@ func emails(addresses []*mail.Address) []string { func mboxes(addresses []*mail.Address) []string { e := make([]string, len(addresses)) for i, addr := range addresses { - parts := strings.SplitN(addr.Address, "@", 1) + parts := strings.SplitN(addr.Address, "@", 2) e[i] = parts[0] } return e |