diff options
Diffstat (limited to 'worker/imap/worker.go')
-rw-r--r-- | worker/imap/worker.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/worker/imap/worker.go b/worker/imap/worker.go index 4d3e51cc..ddd95b6c 100644 --- a/worker/imap/worker.go +++ b/worker/imap/worker.go @@ -66,6 +66,8 @@ func (w *IMAPWorker) handleMessage(msg types.WorkerMessage) error { } } + var reterr error // will be returned at the end, needed to support idle + switch msg := msg.(type) { case *types.Unsupported: // No-op @@ -180,7 +182,7 @@ func (w *IMAPWorker) handleMessage(msg types.WorkerMessage) error { case *types.SearchDirectory: w.handleSearchDirectory(msg) default: - return errUnsupported + reterr = errUnsupported } if w.idleStop != nil { @@ -189,7 +191,7 @@ func (w *IMAPWorker) handleMessage(msg types.WorkerMessage) error { w.idleDone <- w.client.idle.IdleWithFallback(w.idleStop, 0) }() } - return nil + return reterr } func (w *IMAPWorker) handleImapUpdate(update client.Update) { |