Pull BodyStructure up from IMAP worker
This commit is contained in:
parent
5d0402aeea
commit
1f23868652
3 changed files with 40 additions and 10 deletions
lib
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue