summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--widgets/msglist.go1
-rw-r--r--worker/imap/worker.go7
2 files changed, 7 insertions, 1 deletions
diff --git a/widgets/msglist.go b/widgets/msglist.go
index 65473a8..eeadec7 100644
--- a/widgets/msglist.go
+++ b/widgets/msglist.go
@@ -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
 	}
diff --git a/worker/imap/worker.go b/worker/imap/worker.go
index 3d4555f..d0b0e71 100644
--- a/worker/imap/worker.go
+++ b/worker/imap/worker.go
@@ -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)
 	}
 }