Pause event loop only for non-UID FETCHes

This commit is contained in:
Michal Horejsek
2020-12-09 14:14:59 +01:00
parent 5c58089fb7
commit a468ce635c

View File

@ -451,11 +451,13 @@ func (im *imapMailbox) ListMessages(isUID bool, seqSet *imap.SeqSet, items []ima
im.panicHandler.HandlePanic()
}()
// EXPUNGE cannot be sent during listing and can come only from
// the event loop, so we prevent any server side update to avoid
// the problem.
im.user.pauseEventLoop()
defer im.user.unpauseEventLoop()
if !isUID {
// EXPUNGE cannot be sent during listing and can come only from
// the event loop, so we prevent any server side update to avoid
// the problem.
im.user.pauseEventLoop()
defer im.user.unpauseEventLoop()
}
var markAsReadIDs []string
markAsReadMutex := &sync.Mutex{}