Handle external message deletions
This commit is contained in:
parent
026e8a17ca
commit
3ace4ef732
2 changed files with 7 additions and 1 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue