diff options
Diffstat (limited to 'worker/maildir')
-rw-r--r-- | worker/maildir/container.go | 12 | ||||
-rw-r--r-- | worker/maildir/search.go | 3 | ||||
-rw-r--r-- | worker/maildir/worker.go | 10 |
3 files changed, 16 insertions, 9 deletions
diff --git a/worker/maildir/container.go b/worker/maildir/container.go index 83f850ab..1d971a4d 100644 --- a/worker/maildir/container.go +++ b/worker/maildir/container.go @@ -35,8 +35,10 @@ func NewContainer(dir string, maildirpp bool) (*Container, error) { if !s.IsDir() { return nil, fmt.Errorf("Given maildir '%s' not a directory", dir) } - return &Container{dir: dir, uids: uidstore.NewStore(), - recentUIDS: make(map[uint32]struct{}), maildirpp: maildirpp}, nil + return &Container{ + dir: dir, uids: uidstore.NewStore(), + recentUIDS: make(map[uint32]struct{}), maildirpp: maildirpp, + }, nil } // ListFolders returns a list of maildir folders in the container @@ -183,7 +185,8 @@ func (c *Container) DeleteAll(d maildir.Dir, uids []uint32) ([]uint32, error) { } func (c *Container) CopyAll( - dest maildir.Dir, src maildir.Dir, uids []uint32) error { + dest maildir.Dir, src maildir.Dir, uids []uint32, +) error { for _, uid := range uids { if err := c.copyMessage(dest, src, uid); err != nil { return fmt.Errorf("could not copy message %d: %v", uid, err) @@ -193,7 +196,8 @@ func (c *Container) CopyAll( } func (c *Container) copyMessage( - dest maildir.Dir, src maildir.Dir, uid uint32) error { + dest maildir.Dir, src maildir.Dir, uid uint32, +) error { key, ok := c.uids.GetKey(uid) if !ok { return fmt.Errorf("could not find key for message id %d", uid) diff --git a/worker/maildir/search.go b/worker/maildir/search.go index b8e91df0..7a8ba0e0 100644 --- a/worker/maildir/search.go +++ b/worker/maildir/search.go @@ -111,7 +111,8 @@ func (w *Worker) search(criteria *searchCriteria) ([]uint32, error) { // Execute the search criteria for the given key, returns true if search succeeded func (w *Worker) searchKey(key uint32, criteria *searchCriteria, - parts MsgParts) (bool, error) { + parts MsgParts, +) (bool, error) { message, err := w.c.Message(*w.selected, key) if err != nil { return false, err diff --git a/worker/maildir/worker.go b/worker/maildir/worker.go index d60315b8..838a3b7f 100644 --- a/worker/maildir/worker.go +++ b/worker/maildir/worker.go @@ -406,7 +406,8 @@ func (w *Worker) handleOpenDirectory(msg *types.OpenDirectory) error { } func (w *Worker) handleFetchDirectoryContents( - msg *types.FetchDirectoryContents) error { + msg *types.FetchDirectoryContents, +) error { var ( uids []uint32 err error @@ -482,7 +483,8 @@ func (w *Worker) handleRemoveDirectory(msg *types.RemoveDirectory) error { } func (w *Worker) handleFetchMessageHeaders( - msg *types.FetchMessageHeaders) error { + msg *types.FetchMessageHeaders, +) error { for _, uid := range msg.Uids { info, err := w.msgInfoFromUid(uid) if err != nil { @@ -500,8 +502,8 @@ func (w *Worker) handleFetchMessageHeaders( } func (w *Worker) handleFetchMessageBodyPart( - msg *types.FetchMessageBodyPart) error { - + msg *types.FetchMessageBodyPart, +) error { // get reader m, err := w.c.Message(*w.selected, msg.Uid) if err != nil { |