diff options
Diffstat (limited to '')
-rw-r--r-- | internal/imap/folder.go | 10 | ||||
-rw-r--r-- | internal/imap/imap.go | 6 |
2 files changed, 13 insertions, 3 deletions
diff --git a/internal/imap/folder.go b/internal/imap/folder.go index 6353bb3..d7562b8 100644 --- a/internal/imap/folder.go +++ b/internal/imap/folder.go @@ -15,8 +15,16 @@ func (f Folder) Append(other Folder) Folder { if f.delimiter != other.delimiter { panic("Delimiters do not match") } + + var prefix string + if f.str == "" { + prefix = "" + } else { + prefix = f.str + f.delimiter + } + return Folder{ - str: f.str + f.delimiter + other.str, + str: prefix + other.str, delimiter: f.delimiter, } } diff --git a/internal/imap/imap.go b/internal/imap/imap.go index a6995af..4a18a94 100644 --- a/internal/imap/imap.go +++ b/internal/imap/imap.go @@ -39,8 +39,10 @@ func Connect(url config.Url) (*Client, error) { log.Printf("Determined '%s' as toplevel, with '%s' as delimiter", client.toplevel, client.delimiter) - if err = conn.ensureFolder(client.toplevel); err != nil { - return nil, err + if toplevel != "" { + if err = conn.ensureFolder(client.toplevel); err != nil { + return nil, err + } } // the other connections |