diff options
author | Reto Brunner <reto@labrat.space> | 2020-11-10 19:57:09 +0100 |
---|---|---|
committer | Reto Brunner <reto@labrat.space> | 2020-11-14 15:40:13 +0100 |
commit | fc9ccc30008e564c1dea23b3bfe480ca5a10c070 (patch) | |
tree | 80acc77569557d73cbd073def0dabd6472653b5d /worker/lib/parse.go | |
parent | fb67d1f5a3f6fe875d74581aff59c79817a7b9f4 (diff) | |
download | aerc-fc9ccc30008e564c1dea23b3bfe480ca5a10c070.tar.gz |
remove models.Address in favor of go-message Address
We made a new type out of go-message/mail.Address without any real reason. This suddenly made it necessary to convert from one to the other without actually having any benefit whatsoever. This commit gets rid of the additional type
Diffstat (limited to 'worker/lib/parse.go')
-rw-r--r-- | worker/lib/parse.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/worker/lib/parse.go b/worker/lib/parse.go index edd3649..9fa539f 100644 --- a/worker/lib/parse.go +++ b/worker/lib/parse.go @@ -193,19 +193,19 @@ func parseReceivedHeader(h *mail.Header) (time.Time, error) { return time.Parse(time.RFC1123Z, dateRe.FindString(guess)) } -func parseAddressList(h *mail.Header, key string) ([]*models.Address, error) { - var converted []*models.Address +func parseAddressList(h *mail.Header, key string) ([]*mail.Address, error) { + var converted []*mail.Address addrs, err := h.AddressList(key) if err != nil { if hdr, err := h.Text(key); err == nil { - return []*models.Address{&models.Address{ + return []*mail.Address{&mail.Address{ Name: hdr, }}, nil } return nil, err } for _, addr := range addrs { - converted = append(converted, &models.Address{ + converted = append(converted, &mail.Address{ Name: addr.Name, Address: addr.Address, }) |