aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2022-07-26 08:13:21 -0500
committerRobin Jarry <robin@jarry.cc>2022-07-26 22:24:01 +0200
commit6db766260b7c23ec113e31010e0ac68105622956 (patch)
tree8aad8e5b50278c9c2f7e90f607bda3f7da06cc97 /lib
parent26b9c3d9665db0d5a7990f75fc1baccc0139e7a5 (diff)
downloadaerc-6db766260b7c23ec113e31010e0ac68105622956.tar.gz
sort: clear sort criteria when called without arguments
Fix a regression introduced by commit c2f4404fca15 ("threading: enable filtering of server-side threads"). Prior to this commit, a :sort command (no args) would clear out the current sort criteria (or rather, apply the value from the config). Restore this functionality. Fixes: c2f4404fca15 ("threading: enable filtering of server-side threads") Reported-by: akspecs <akspecs@gmail.com> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib')
-rw-r--r--lib/msgstore.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go
index c9f8fd91..d9140d7b 100644
--- a/lib/msgstore.go
+++ b/lib/msgstore.go
@@ -801,11 +801,7 @@ func (store *MessageStore) ModifyLabels(uids []uint32, add, remove []string,
}
func (store *MessageStore) Sort(criteria []*types.SortCriterion, cb func(types.WorkerMessage)) {
- if criteria == nil {
- criteria = store.sortCriteria
- } else {
- store.sortCriteria = criteria
- }
+ store.sortCriteria = criteria
store.Sorting = true
handle_return := func(msg types.WorkerMessage) {
@@ -828,6 +824,10 @@ func (store *MessageStore) Sort(criteria []*types.SortCriterion, cb func(types.W
}
}
+func (store *MessageStore) GetCurrentSortCriteria() []*types.SortCriterion {
+ return store.sortCriteria
+}
+
// returns the index of needle in haystack or -1 if not found
func (store *MessageStore) visualStartIdx() int {
for idx, u := range store.Uids() {