Skip to content

Commit

Permalink
jmap: fix message list order direction
Browse files Browse the repository at this point in the history
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 <[email protected]>
Tested-by: Tim Culverhouse <[email protected]>
  • Loading branch information
rjarry committed Jun 5, 2024
1 parent a5bd99c commit 73bcb46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion worker/jmap/directories.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 73bcb46

Please sign in to comment.