aboutsummaryrefslogtreecommitdiffstats
path: root/worker/imap/worker.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-06-09 14:55:04 -0400
committerDrew DeVault <sir@cmpwn.com>2019-06-09 14:55:04 -0400
commit05f00f0153066b9bb527773927a3244dad28ef4f (patch)
tree1e3dbd574e358fbeaf4cf46774baf1a329f649ab /worker/imap/worker.go
parentd63653ecdeb19c0fb4b3ea976c3e5ea96b408112 (diff)
downloadaerc-05f00f0153066b9bb527773927a3244dad28ef4f.tar.gz
Update our message flags when server updates them
Diffstat (limited to 'worker/imap/worker.go')
-rw-r--r--worker/imap/worker.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/worker/imap/worker.go b/worker/imap/worker.go
index f71a950d..373072b1 100644
--- a/worker/imap/worker.go
+++ b/worker/imap/worker.go
@@ -171,6 +171,18 @@ func (w *IMAPWorker) handleImapUpdate(update client.Update) {
Recent: int(status.Recent),
Unseen: int(status.Unseen),
}, nil)
+ case *client.MessageUpdate:
+ msg := update.Message
+ if msg.Uid == 0 {
+ msg.Uid = w.seqMap[msg.SeqNum-1]
+ }
+ w.worker.PostMessage(&types.MessageInfo{
+ BodyStructure: msg.BodyStructure,
+ Envelope: msg.Envelope,
+ Flags: msg.Flags,
+ InternalDate: msg.InternalDate,
+ Uid: msg.Uid,
+ }, nil)
case *client.ExpungeUpdate:
i := update.SeqNum - 1
uid := w.seqMap[i]