aboutsummaryrefslogtreecommitdiffstats
path: root/lib/format/format.go
diff options
context:
space:
mode:
authorReto Brunner <reto@labrat.space>2020-11-10 20:27:30 +0100
committerReto Brunner <reto@labrat.space>2020-11-14 15:40:13 +0100
commit20ec2c8eeb2e071f28358814935a0f56672a9f49 (patch)
tree501b43a39a4152872bb6f08221da9c37fc75559c /lib/format/format.go
parent3ad3a5ede07c1248ae8176bdc19a623731c64056 (diff)
downloadaerc-20ec2c8eeb2e071f28358814935a0f56672a9f49.tar.gz
compose: use a proper header instead of a string map
Prior to this commit, the composer was based on a map[string]string. While this approach was very versatile, it lead to a constant encoding / decoding of addresses and other headers. This commit switches to a different model, where the composer is based on a header. Commands which want to interact with it can simply set some defaults they would like to have. Users can overwrite them however they like. In order to get access to the functions generating / getting the msgid go-message was upgraded.
Diffstat (limited to 'lib/format/format.go')
-rw-r--r--lib/format/format.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/format/format.go b/lib/format/format.go
index e19ca319..2ba4d646 100644
--- a/lib/format/format.go
+++ b/lib/format/format.go
@@ -61,6 +61,7 @@ func AddressForHumans(a *mail.Address) string {
var atom *regexp.Regexp = regexp.MustCompile("^[a-z0-9!#$%7'*+-/=?^_`{}|~ ]+$")
+// FormatAddresses formats a list of addresses into a human readable string
func FormatAddresses(l []*mail.Address) string {
formatted := make([]string, len(l))
for i, a := range l {