diff options
-rw-r--r-- | CHANGELOG.md | 4 | ||||
-rw-r--r-- | commands/msg/archive.go | 16 |
2 files changed, 15 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 95043c45..a4b73809 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). in `aerc.conf`. - IMAP now uses the delimiter advertised by the server +### Fixed + +- `:archive` now works on servers using a different delimiter + ## [0.15.2](https://git.sr.ht/~rjarry/aerc/refs/0.15.2) - 2023-05-11 ### Fixed diff --git a/commands/msg/archive.go b/commands/msg/archive.go index aeb65738..1c9d7929 100644 --- a/commands/msg/archive.go +++ b/commands/msg/archive.go @@ -3,7 +3,7 @@ package msg import ( "errors" "fmt" - "path" + "strings" "sync" "git.sr.ht/~rjarry/aerc/commands" @@ -70,15 +70,21 @@ func archive(aerc *widgets.Aerc, msgs []*models.MessageInfo, archiveType string) switch archiveType { case ARCHIVE_MONTH: uidMap = groupBy(msgs, func(msg *models.MessageInfo) string { - dir := path.Join(archiveDir, + dir := strings.Join([]string{ + archiveDir, fmt.Sprintf("%d", msg.Envelope.Date.Year()), - fmt.Sprintf("%02d", msg.Envelope.Date.Month())) + fmt.Sprintf("%02d", msg.Envelope.Date.Month()), + }, aerc.SelectedAccount().Worker().PathSeparator(), + ) return dir }) case ARCHIVE_YEAR: uidMap = groupBy(msgs, func(msg *models.MessageInfo) string { - dir := path.Join(archiveDir, fmt.Sprintf("%v", - msg.Envelope.Date.Year())) + dir := strings.Join([]string{ + archiveDir, + fmt.Sprintf("%v", msg.Envelope.Date.Year()), + }, aerc.SelectedAccount().Worker().PathSeparator(), + ) return dir }) case ARCHIVE_FLAT: |