diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-04-19 22:09:58 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-04-19 22:09:58 +0200 |
commit | 76f0beb3db5ef7b3ecac6354bc29a76fef27829a (patch) | |
tree | 3e92f899f9174fc50f0e575097b861e40e9a60d2 | |
parent | 9b982a82c150c65a5f72c9b548053553b2c3b0fb (diff) | |
download | feed2imap-go-76f0beb3db5ef7b3ecac6354bc29a76fef27829a.tar.gz feed2imap-go-76f0beb3db5ef7b3ecac6354bc29a76fef27829a.tar.bz2 feed2imap-go-76f0beb3db5ef7b3ecac6354bc29a76fef27829a.zip |
SELECT is not necessary for most operations -- skip it
Diffstat (limited to '')
-rw-r--r-- | internal/imap/client.go | 10 | ||||
-rw-r--r-- | internal/imap/imap.go | 3 |
2 files changed, 1 insertions, 12 deletions
diff --git a/internal/imap/client.go b/internal/imap/client.go index 7440ed7..7569fb8 100644 --- a/internal/imap/client.go +++ b/internal/imap/client.go @@ -84,16 +84,6 @@ func (client *Client) list(folder string) (*imap.MailboxInfo, int, error) { return mbox, found, nil } -func (client *Client) selectToplevel() (err error) { - err = client.EnsureFolder(client.toplevel) - - if err == nil { - _, err = client.c.Select(client.toplevel, false) - } - - return -} - func (client *Client) fetchDelimiter() error { mbox, _, err := client.list("") if err != nil { diff --git a/internal/imap/imap.go b/internal/imap/imap.go index ac24b9d..f2a9082 100644 --- a/internal/imap/imap.go +++ b/internal/imap/imap.go @@ -120,8 +120,7 @@ func Connect(url *url.URL) (*Client, error) { log.Printf("Determined '%s' as toplevel, with '%s' as delimiter", client.toplevel, client.delimiter) - // Go to toplevel folder by default, so that the rest is relative - if err = client.selectToplevel(); err != nil { + if err = client.EnsureFolder(client.toplevel); err != nil { return nil, err } |