aboutsummaryrefslogtreecommitdiffstats
path: root/worker/lib
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2022-11-07 10:15:48 -0600
committerRobin Jarry <robin@jarry.cc>2022-11-09 21:26:34 +0100
commitca903d4228265272a0f6a780f5ed2280772eceec (patch)
tree6c50f6c5c0171ca80e655d47446272cddbffd9ee /worker/lib
parente0d279d6128a22db56326557883ad790544bc4f7 (diff)
downloadaerc-ca903d4228265272a0f6a780f5ed2280772eceec.tar.gz
envelope: add InReplyTo field
A standard IMAP envelope response includes the In-Reply-To header field. Add this field to the aerc model of Envelope. Update envelope parser to set this value. Update imap worker to set this value. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'worker/lib')
-rw-r--r--worker/lib/parse.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/worker/lib/parse.go b/worker/lib/parse.go
index f57a56ac..6b33d246 100644
--- a/worker/lib/parse.go
+++ b/worker/lib/parse.go
@@ -164,6 +164,14 @@ func parseEnvelope(h *mail.Header) (*models.Envelope, error) {
return nil, err
}
}
+ irtList, err := h.MsgIDList("in-reply-to")
+ if err != nil {
+ return nil, err
+ }
+ irt := ""
+ if len(irtList) > 0 {
+ irt = irtList[0]
+ }
date, err := parseDate(h)
if err != nil {
// still return a valid struct plus a sentinel date parsing error
@@ -179,6 +187,7 @@ func parseEnvelope(h *mail.Header) (*models.Envelope, error) {
To: to,
Cc: cc,
Bcc: bcc,
+ InReplyTo: irt,
}, err
}