Handle external message deletions

This commit is contained in:
Drew DeVault 2019-05-13 20:23:23 -04:00
parent 026e8a17ca
commit 3ace4ef732
2 changed files with 7 additions and 1 deletions

View File

@ -109,7 +109,6 @@ func (ml *MessageList) Height() int {
} }
func (ml *MessageList) storeUpdate(store *lib.MessageStore) { func (ml *MessageList) storeUpdate(store *lib.MessageStore) {
ml.logger.Println("message store updated")
if ml.Store() != store { if ml.Store() != store {
return return
} }

View File

@ -204,6 +204,13 @@ func (w *IMAPWorker) handleImapUpdate(update client.Update) {
Recent: int(status.Recent), Recent: int(status.Recent),
Unseen: int(status.Unseen), Unseen: int(status.Unseen),
}, nil) }, nil)
case *client.ExpungeUpdate:
i := update.SeqNum - 1
uid := w.seqMap[i]
w.seqMap = append(w.seqMap[:i], w.seqMap[i+1:]...)
w.worker.PostMessage(&types.MessagesDeleted{
Uids: []uint32{uid},
}, nil)
} }
} }