aboutsummaryrefslogtreecommitdiffstats
path: root/worker/lib/parse.go
diff options
context:
space:
mode:
authorReto Brunner <reto@labrat.space>2019-12-23 12:51:58 +0100
committerDrew DeVault <sir@cmpwn.com>2019-12-27 10:20:29 -0700
commit63391b7dca09e3f2cf3c4ff903592d23fe8f56a3 (patch)
tree4d1d4f918bd1a9536991a763c945139f89b8065e /worker/lib/parse.go
parent6794ce0d9cce89d5fab726d7bc93a77b47cea677 (diff)
downloadaerc-63391b7dca09e3f2cf3c4ff903592d23fe8f56a3.tar.gz
Add labels to index format (%g)
Exposes the notmuch tags accordingly, stubs it for the maildir worker.
Diffstat (limited to 'worker/lib/parse.go')
-rw-r--r--worker/lib/parse.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/worker/lib/parse.go b/worker/lib/parse.go
index c3a43ca5..eed39cb9 100644
--- a/worker/lib/parse.go
+++ b/worker/lib/parse.go
@@ -207,6 +207,7 @@ func parseAddressList(h *mail.Header, key string) ([]*models.Address, error) {
type RawMessage interface {
NewReader() (io.Reader, error)
ModelFlags() ([]models.Flag, error)
+ Labels() ([]string, error)
UID() uint32
}
@@ -233,10 +234,15 @@ func MessageInfo(raw RawMessage) (*models.MessageInfo, error) {
if err != nil {
return nil, err
}
+ labels, err := raw.Labels()
+ if err != nil {
+ return nil, err
+ }
return &models.MessageInfo{
BodyStructure: bs,
Envelope: env,
Flags: flags,
+ Labels: labels,
InternalDate: env.Date,
RFC822Headers: &mail.Header{msg.Header},
Size: 0,