diff options
author | Jeffas <dev@jeffas.io> | 2019-09-19 23:37:44 +0100 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-09-20 14:56:02 -0400 |
commit | 90d26da58a4af2d34328f5916adf3781222966c6 (patch) | |
tree | 58a60e0d42b183f94d12b35e19ed1b046d03d5cd /worker/types | |
parent | 43435ba06cd0820a83f14630881981b338473cb8 (diff) | |
download | aerc-90d26da58a4af2d34328f5916adf3781222966c6.tar.gz |
Add sorting functionality
There is a command and config option. The criteria are a list of the sort criterion and each can be individually reversed. This only includes support for sorting in the maildir backend currently. The other backends are not supported in this patch.
Diffstat (limited to 'worker/types')
-rw-r--r-- | worker/types/messages.go | 1 | ||||
-rw-r--r-- | worker/types/sort.go | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/worker/types/messages.go b/worker/types/messages.go index 9f40b8f..3539139 100644 --- a/worker/types/messages.go +++ b/worker/types/messages.go @@ -78,6 +78,7 @@ type OpenDirectory struct { type FetchDirectoryContents struct { Message + SortCriteria []*SortCriterion } type SearchDirectory struct { diff --git a/worker/types/sort.go b/worker/types/sort.go new file mode 100644 index 0000000..ffbcf46 --- /dev/null +++ b/worker/types/sort.go @@ -0,0 +1,19 @@ +package types + +type SortField int + +const ( + SortArrival SortField = iota + SortCc + SortDate + SortFrom + SortRead + SortSize + SortSubject + SortTo +) + +type SortCriterion struct { + Field SortField + Reverse bool +} |