diff options
Diffstat (limited to 'worker/imap')
-rw-r--r-- | worker/imap/open.go | 3 | ||||
-rw-r--r-- | worker/imap/worker.go | 6 |
2 files changed, 2 insertions, 7 deletions
diff --git a/worker/imap/open.go b/worker/imap/open.go index 891b8a23..0a0d9fea 100644 --- a/worker/imap/open.go +++ b/worker/imap/open.go @@ -18,9 +18,6 @@ func (imapw *IMAPWorker) handleOpenDirectory(msg *types.OpenDirectory) { }, nil) } else { imapw.worker.PostMessage(&types.Done{types.RespondTo(msg)}, nil) - if imapw.idleStop == nil { - imapw.idleStop = make(chan struct{}) - } } } diff --git a/worker/imap/worker.go b/worker/imap/worker.go index dab0afb5..7e009669 100644 --- a/worker/imap/worker.go +++ b/worker/imap/worker.go @@ -7,7 +7,6 @@ import ( "strings" "github.com/emersion/go-imap" - idle "github.com/emersion/go-imap-idle" sortthread "github.com/emersion/go-imap-sortthread" "github.com/emersion/go-imap/client" "golang.org/x/oauth2" @@ -27,7 +26,6 @@ var errUnsupported = fmt.Errorf("unsupported command") type imapClient struct { *client.Client - idle *idle.IdleClient sort *sortthread.SortClient } @@ -157,7 +155,7 @@ func (w *IMAPWorker) handleMessage(msg types.WorkerMessage) error { } c.Updates = w.updates - w.client = &imapClient{c, idle.NewClient(c), sortthread.NewSortClient(c)} + w.client = &imapClient{c, sortthread.NewSortClient(c)} w.worker.PostMessage(&types.Done{types.RespondTo(msg)}, nil) case *types.ListDirectories: w.handleListDirectories(msg) @@ -194,7 +192,7 @@ func (w *IMAPWorker) handleMessage(msg types.WorkerMessage) error { if w.idleStop != nil { w.idleStop = make(chan struct{}) go func() { - w.idleDone <- w.client.idle.IdleWithFallback(w.idleStop, 0) + w.idleDone <- w.client.Idle(w.idleStop, &client.IdleOptions{0, 0}) }() } return reterr |