diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2021-02-21 17:43:10 +0100 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2021-02-21 17:43:31 +0100 |
commit | 48c40ede273bec2f53dd8164db46f902a0b527c8 (patch) | |
tree | 77f211158d04abc0ac71222a036d99909e133539 /internal/imap | |
parent | a67e0e15cb1ff73c0faf7b4f9cdcd168ffbfa423 (diff) | |
download | feed2imap-go-48c40ede273bec2f53dd8164db46f902a0b527c8.tar.gz feed2imap-go-48c40ede273bec2f53dd8164db46f902a0b527c8.tar.bz2 feed2imap-go-48c40ede273bec2f53dd8164db46f902a0b527c8.zip |
#25 Normalize folder names
Diffstat (limited to '')
-rw-r--r-- | internal/imap/folder.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/internal/imap/folder.go b/internal/imap/folder.go index e845862..6353bb3 100644 --- a/internal/imap/folder.go +++ b/internal/imap/folder.go @@ -21,9 +21,17 @@ func (f Folder) Append(other Folder) Folder { } } +func buildFolderName(path []string, delimiter string) (name string) { + name = strings.Join(path, delimiter) + if delimiter != "" { + name = strings.Trim(name, delimiter[0:1]) + } + return +} + func (cl *Client) folderName(path []string) Folder { return Folder{ - strings.Join(path, cl.delimiter), + buildFolderName(path, cl.delimiter), cl.delimiter, } } |