From 31d2f5be3cec88d82924816c3482253557999e63 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Mon, 7 Nov 2022 10:15:49 -0600 Subject: message-info: add explicit References field Add an explicit References field to message info. This is useful for storing information needed for threading without storing all of the header values, keeping system RAM usage lower. Signed-off-by: Tim Culverhouse Tested-by: Inwit Acked-by: Robin Jarry --- models/models.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'models/models.go') diff --git a/models/models.go b/models/models.go index d730229c..fb628f63 100644 --- a/models/models.go +++ b/models/models.go @@ -71,6 +71,7 @@ type MessageInfo struct { Labels []string InternalDate time.Time RFC822Headers *mail.Header + Refs []string Size uint32 Uid uint32 Error error @@ -110,6 +111,9 @@ func (mi *MessageInfo) References() ([]string, error) { if mi == nil { return []string{}, errors.New("msg is nil") } + if mi.Refs != nil { + return mi.Refs, nil + } if mi.RFC822Headers == nil { return []string{}, errors.New("header is nil") } -- cgit