diff options
Diffstat (limited to 'worker/imap')
-rw-r--r-- | worker/imap/create.go | 2 | ||||
-rw-r--r-- | worker/imap/fetch.go | 6 | ||||
-rw-r--r-- | worker/imap/flags.go | 6 | ||||
-rw-r--r-- | worker/imap/list.go | 2 | ||||
-rw-r--r-- | worker/imap/movecopy.go | 4 | ||||
-rw-r--r-- | worker/imap/open.go | 8 | ||||
-rw-r--r-- | worker/imap/remove.go | 2 | ||||
-rw-r--r-- | worker/imap/worker.go | 8 |
8 files changed, 19 insertions, 19 deletions
diff --git a/worker/imap/create.go b/worker/imap/create.go index 4cc5c5ac..5bac0017 100644 --- a/worker/imap/create.go +++ b/worker/imap/create.go @@ -14,6 +14,6 @@ func (imapw *IMAPWorker) handleCreateDirectory(msg *types.CreateDirectory) { Error: err, }, nil) } else { - imapw.worker.PostMessage(&types.Done{types.RespondTo(msg)}, nil) + imapw.worker.PostMessage(&types.Done{Message: types.RespondTo(msg)}, nil) } } diff --git a/worker/imap/fetch.go b/worker/imap/fetch.go index 19f4fa3d..364fe575 100644 --- a/worker/imap/fetch.go +++ b/worker/imap/fetch.go @@ -46,7 +46,7 @@ func (imapw *IMAPWorker) handleFetchMessageHeaders( }, nil) return nil } - header := &mail.Header{message.Header{textprotoHeader}} + header := &mail.Header{Header: message.Header{Header: textprotoHeader}} imapw.worker.PostMessage(&types.MessageInfo{ Message: types.RespondTo(msg), Info: &models.MessageInfo{ @@ -100,7 +100,7 @@ func (imapw *IMAPWorker) handleFetchMessageBodyPart( return fmt.Errorf("failed to read part header: %v", err) } - part, err := message.New(message.Header{h}, + part, err := message.New(message.Header{Header: h}, _msg.GetBody(&partBodySection)) if err != nil { return fmt.Errorf("failed to create message reader: %v", err) @@ -202,5 +202,5 @@ func (imapw *IMAPWorker) handleFetchMessages( return } imapw.worker.PostMessage( - &types.Done{types.RespondTo(msg)}, nil) + &types.Done{Message: types.RespondTo(msg)}, nil) } diff --git a/worker/imap/flags.go b/worker/imap/flags.go index 7ab82f25..cc8a8cee 100644 --- a/worker/imap/flags.go +++ b/worker/imap/flags.go @@ -40,7 +40,7 @@ func (imapw *IMAPWorker) handleDeleteMessages(msg *types.DeleteMessages) { Message: types.RespondTo(msg), Uids: deleted, }, nil) - imapw.worker.PostMessage(&types.Done{types.RespondTo(msg)}, nil) + imapw.worker.PostMessage(&types.Done{Message: types.RespondTo(msg)}, nil) } } @@ -71,7 +71,7 @@ func (imapw *IMAPWorker) handleAnsweredMessages(msg *types.AnsweredMessages) { imapw.worker.Logger.Printf("could not fetch headers: %s", err) emitErr(err) case *types.Done: - imapw.worker.PostMessage(&types.Done{types.RespondTo(msg)}, nil) + imapw.worker.PostMessage(&types.Done{Message: types.RespondTo(msg)}, nil) } }) } @@ -102,7 +102,7 @@ func (imapw *IMAPWorker) handleFlagMessages(msg *types.FlagMessages) { imapw.worker.Logger.Printf("could not fetch headers: %s", err) emitErr(err) case *types.Done: - imapw.worker.PostMessage(&types.Done{types.RespondTo(msg)}, nil) + imapw.worker.PostMessage(&types.Done{Message: types.RespondTo(msg)}, nil) } }) } diff --git a/worker/imap/list.go b/worker/imap/list.go index 9cff2c44..25c247a2 100644 --- a/worker/imap/list.go +++ b/worker/imap/list.go @@ -38,7 +38,7 @@ func (imapw *IMAPWorker) handleListDirectories(msg *types.ListDirectories) { } else { <-done imapw.worker.PostMessage( - &types.Done{types.RespondTo(msg)}, nil) + &types.Done{Message: types.RespondTo(msg)}, nil) } } diff --git a/worker/imap/movecopy.go b/worker/imap/movecopy.go index 38f23ab0..0b19ead3 100644 --- a/worker/imap/movecopy.go +++ b/worker/imap/movecopy.go @@ -14,7 +14,7 @@ func (imapw *IMAPWorker) handleCopyMessages(msg *types.CopyMessages) { Error: err, }, nil) } else { - imapw.worker.PostMessage(&types.Done{types.RespondTo(msg)}, nil) + imapw.worker.PostMessage(&types.Done{Message: types.RespondTo(msg)}, nil) } } @@ -39,6 +39,6 @@ func (imapw *IMAPWorker) handleAppendMessage(msg *types.AppendMessage) { Error: err, }, nil) } else { - imapw.worker.PostMessage(&types.Done{types.RespondTo(msg)}, nil) + imapw.worker.PostMessage(&types.Done{Message: types.RespondTo(msg)}, nil) } } diff --git a/worker/imap/open.go b/worker/imap/open.go index 28495731..238f1e25 100644 --- a/worker/imap/open.go +++ b/worker/imap/open.go @@ -19,7 +19,7 @@ func (imapw *IMAPWorker) handleOpenDirectory(msg *types.OpenDirectory) { Error: err, }, nil) } else { - imapw.worker.PostMessage(&types.Done{types.RespondTo(msg)}, nil) + imapw.worker.PostMessage(&types.Done{Message: types.RespondTo(msg)}, nil) } } @@ -67,7 +67,7 @@ func (imapw *IMAPWorker) handleFetchDirectoryContents( Message: types.RespondTo(msg), Uids: uids, }, nil) - imapw.worker.PostMessage(&types.Done{types.RespondTo(msg)}, nil) + imapw.worker.PostMessage(&types.Done{Message: types.RespondTo(msg)}, nil) } } @@ -89,7 +89,7 @@ func translateSortCriterions( result := make([]sortthread.SortCriterion, 0, len(cs)) for _, c := range cs { if f, ok := sortFieldMap[c.Field]; ok { - result = append(result, sortthread.SortCriterion{f, c.Reverse}) + result = append(result, sortthread.SortCriterion{Field: f, Reverse: c.Reverse}) } } return result @@ -117,7 +117,7 @@ func (imapw *IMAPWorker) handleDirectoryThreaded( Message: types.RespondTo(msg), Threads: aercThreads, }, nil) - imapw.worker.PostMessage(&types.Done{types.RespondTo(msg)}, nil) + imapw.worker.PostMessage(&types.Done{Message: types.RespondTo(msg)}, nil) } } diff --git a/worker/imap/remove.go b/worker/imap/remove.go index aff36be3..688b6a94 100644 --- a/worker/imap/remove.go +++ b/worker/imap/remove.go @@ -14,6 +14,6 @@ func (imapw *IMAPWorker) handleRemoveDirectory(msg *types.RemoveDirectory) { Error: err, }, nil) } else { - imapw.worker.PostMessage(&types.Done{types.RespondTo(msg)}, nil) + imapw.worker.PostMessage(&types.Done{Message: types.RespondTo(msg)}, nil) } } diff --git a/worker/imap/worker.go b/worker/imap/worker.go index 019df8bb..6bc850cb 100644 --- a/worker/imap/worker.go +++ b/worker/imap/worker.go @@ -83,7 +83,7 @@ func (w *IMAPWorker) handleMessage(msg types.WorkerMessage) error { if w.client != nil && w.client.State() == imap.SelectedState { w.idleStop = make(chan struct{}) go func() { - w.idleDone <- w.client.Idle(w.idleStop, &client.IdleOptions{0, 0}) + w.idleDone <- w.client.Idle(w.idleStop, &client.IdleOptions{LogoutTimeout: 0, PollInterval: 0}) }() } }() @@ -203,7 +203,7 @@ func (w *IMAPWorker) handleMessage(msg types.WorkerMessage) error { w.startConnectionObserver() - w.worker.PostMessage(&types.Done{types.RespondTo(msg)}, nil) + w.worker.PostMessage(&types.Done{Message: types.RespondTo(msg)}, nil) case *types.Reconnect: if !w.autoReconnect { reterr = fmt.Errorf("auto-reconnect is disabled; run connect to enable it") @@ -225,7 +225,7 @@ func (w *IMAPWorker) handleMessage(msg types.WorkerMessage) error { w.startConnectionObserver() - w.worker.PostMessage(&types.Done{types.RespondTo(msg)}, nil) + w.worker.PostMessage(&types.Done{Message: types.RespondTo(msg)}, nil) case *types.Disconnect: w.autoReconnect = false w.stopConnectionObserver() @@ -238,7 +238,7 @@ func (w *IMAPWorker) handleMessage(msg types.WorkerMessage) error { reterr = err break } - w.worker.PostMessage(&types.Done{types.RespondTo(msg)}, nil) + w.worker.PostMessage(&types.Done{Message: types.RespondTo(msg)}, nil) case *types.ListDirectories: w.handleListDirectories(msg) case *types.OpenDirectory: |