~sircmpwn/aerc

3ace4ef73245577d5d407f48a8214de72b70b57d — Drew DeVault 2 years ago 026e8a1
Handle external message deletions
2 files changed, 7 insertions(+), 1 deletions(-)

M widgets/msglist.go
M worker/imap/worker.go
M widgets/msglist.go => widgets/msglist.go +0 -1
@@ 109,7 109,6 @@ func (ml *MessageList) Height() int {
}

func (ml *MessageList) storeUpdate(store *lib.MessageStore) {
	ml.logger.Println("message store updated")
	if ml.Store() != store {
		return
	}

M worker/imap/worker.go => worker/imap/worker.go +7 -0
@@ 204,6 204,13 @@ func (w *IMAPWorker) handleImapUpdate(update client.Update) {
			Recent: int(status.Recent),
			Unseen: int(status.Unseen),
		}, 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)
	}
}