summary refs log tree commit diff stats
path: root/lib/msgstore.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-31 11:10:10 -0400
committerDrew DeVault <sir@cmpwn.com>2019-03-31 11:10:10 -0400
commit1f23868652a2ce0e81bddd048e3e828efaff2d69 (patch)
tree9d7fd0362d7b43df2d674ac2ad17b79e2c2196a9 /lib/msgstore.go
parent5d0402aeea1dcc69adb46227ab1cd73b5e768880 (diff)
downloadaerc-1f23868652a2ce0e81bddd048e3e828efaff2d69.tar.gz
Pull BodyStructure up from IMAP worker
Diffstat (limited to 'lib/msgstore.go')
-rw-r--r--lib/msgstore.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go
index 3c77c49..c6cd2c3 100644
--- a/lib/msgstore.go
+++ b/lib/msgstore.go
@@ -1,6 +1,8 @@
 package lib
 
 import (
+	"time"
+
 	"github.com/emersion/go-imap"
 	"github.com/mohamedattahri/mail"
 
@@ -91,10 +93,22 @@ func (store *MessageStore) FetchBodies(uids []uint32,
 func (store *MessageStore) merge(
 	to *types.MessageInfo, from *types.MessageInfo) {
 
-	// TODO: Merge more shit
+	if from.BodyStructure != nil {
+		to.BodyStructure = from.BodyStructure
+	}
 	if from.Envelope != nil {
 		to.Envelope = from.Envelope
 	}
+	if len(from.Flags) != 0 {
+		to.Flags = from.Flags
+	}
+	if from.Size != 0 {
+		to.Size = from.Size
+	}
+	var zero time.Time
+	if from.InternalDate != zero {
+		to.InternalDate = from.InternalDate
+	}
 }
 
 func (store *MessageStore) Update(msg types.WorkerMessage) {