summary refs log tree commit diff stats
path: root/worker
diff options
context:
space:
mode:
Diffstat (limited to 'worker')
-rw-r--r--worker/lib/parse.go6
-rw-r--r--worker/maildir/message.go4
-rw-r--r--worker/notmuch/message.go4
3 files changed, 14 insertions, 0 deletions
diff --git a/worker/lib/parse.go b/worker/lib/parse.go
index c3a43ca..eed39cb 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,
diff --git a/worker/maildir/message.go b/worker/maildir/message.go
index dc5646b..45b1ca6 100644
--- a/worker/maildir/message.go
+++ b/worker/maildir/message.go
@@ -119,3 +119,7 @@ func translateFlags(maildirFlags []maildir.Flag) []models.Flag {
 func (m Message) UID() uint32 {
 	return m.uid
 }
+
+func (m Message) Labels() ([]string, error) {
+	return nil, nil
+}
diff --git a/worker/notmuch/message.go b/worker/notmuch/message.go
index c51e2e9..ec1adb9 100644
--- a/worker/notmuch/message.go
+++ b/worker/notmuch/message.go
@@ -102,6 +102,10 @@ func (m *Message) Tags() ([]string, error) {
 	return m.db.MsgTags(m.key)
 }
 
+func (m *Message) Labels() ([]string, error) {
+	return m.Tags()
+}
+
 func (m *Message) ModelFlags() ([]models.Flag, error) {
 	var flags []models.Flag
 	seen := true