aboutsummaryrefslogtreecommitdiff
path: root/internal/imap/folder.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--internal/imap/folder.go10
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,
}
}