From 73bcb4661460d44817de2904fec14a69af819f43 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Wed, 5 Jun 2024 16:25:05 +0200 Subject: [PATCH] jmap: fix message list order direction Since the update to go-jmap 0.5.0, the IsAscending property is now taken into account even if it is false. The initial JMAP implementation wrongfully assumed the behaviour and inverted the sort -r logic. Fix that so that messages are ordered as expected. Link: https://git.sr.ht/~rockorager/go-jmap/commit/1db959676c10398a8 Signed-off-by: Robin Jarry Tested-by: Tim Culverhouse --- worker/jmap/directories.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/jmap/directories.go b/worker/jmap/directories.go index 2b253975..66875cc7 100644 --- a/worker/jmap/directories.go +++ b/worker/jmap/directories.go @@ -349,7 +349,7 @@ func translateSort(criteria []*types.SortCriterion) []*email.SortComparator { default: continue } - cmp.IsAscending = !s.Reverse + cmp.IsAscending = s.Reverse sort = append(sort, &cmp) }