aboutsummaryrefslogtreecommitdiffstats
path: root/worker
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2022-07-26 07:22:19 -0500
committerRobin Jarry <robin@jarry.cc>2022-07-26 22:24:28 +0200
commitea718fe146fa21f6899179a17e218a670b832ee8 (patch)
treebd5c1fa100057bd52b3568a7dffff6d0dc352d3a /worker
parent6db766260b7c23ec113e31010e0ac68105622956 (diff)
downloadaerc-ea718fe146fa21f6899179a17e218a670b832ee8.tar.gz
imap: remove unused expunge code
Remove unused code in the handleDeleteMessages routine. During debugging, it was found that the channel for expunge updates was not working and that all expunge details were coming through as ExpungeUpdates. The reporting channel is unneeded. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'worker')
-rw-r--r--worker/imap/flags.go22
1 files changed, 1 insertions, 21 deletions
diff --git a/worker/imap/flags.go b/worker/imap/flags.go
index 5b2ac410..bda47e9d 100644
--- a/worker/imap/flags.go
+++ b/worker/imap/flags.go
@@ -20,32 +20,12 @@ func (imapw *IMAPWorker) handleDeleteMessages(msg *types.DeleteMessages) {
}, nil)
return
}
- var deleted []uint32
- ch := make(chan uint32)
- done := make(chan interface{})
- go func() {
- defer logging.PanicHandler()
-
- for seqNum := range ch {
- if uid, found := imapw.seqMap.Pop(seqNum); !found {
- logging.Errorf("handleDeleteMessages unknown seqnum: %d", seqNum)
- } else {
- deleted = append(deleted, uid)
- }
- }
- done <- nil
- }()
- if err := imapw.client.Expunge(ch); err != nil {
+ if err := imapw.client.Expunge(nil); err != nil {
imapw.worker.PostMessage(&types.Error{
Message: types.RespondTo(msg),
Error: err,
}, nil)
} else {
- <-done
- imapw.worker.PostMessage(&types.MessagesDeleted{
- Message: types.RespondTo(msg),
- Uids: deleted,
- }, nil)
imapw.worker.PostMessage(&types.Done{Message: types.RespondTo(msg)}, nil)
}
}