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>
This commit is contained in:
Tim Culverhouse 2022-07-26 07:22:19 -05:00 committed by Robin Jarry
parent 6db766260b
commit ea718fe146

View file

@ -20,32 +20,12 @@ func (imapw *IMAPWorker) handleDeleteMessages(msg *types.DeleteMessages) {
}, nil) }, nil)
return return
} }
var deleted []uint32 if err := imapw.client.Expunge(nil); err != nil {
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 {
imapw.worker.PostMessage(&types.Error{ imapw.worker.PostMessage(&types.Error{
Message: types.RespondTo(msg), Message: types.RespondTo(msg),
Error: err, Error: err,
}, nil) }, nil)
} else { } else {
<-done
imapw.worker.PostMessage(&types.MessagesDeleted{
Message: types.RespondTo(msg),
Uids: deleted,
}, nil)
imapw.worker.PostMessage(&types.Done{Message: types.RespondTo(msg)}, nil) imapw.worker.PostMessage(&types.Done{Message: types.RespondTo(msg)}, nil)
} }
} }