summaryrefslogtreecommitdiff
path: root/lib/threadbuilder.go
diff options
context:
space:
mode:
authorcos <cos>2022-07-26 20:38:24 +0200
committercos <cos>2022-07-26 22:47:44 +0200
commitf5c9f2d0111527b5d5d2efed2e94a01b9f382709 (patch)
treeef92c037d9fe0fbc1372fa0ab5e96acd38267d65 /lib/threadbuilder.go
parenta70697d1224cbb13dae99a50238e62650eee587c (diff)
downloadaerc-f5c9f2d0111527b5d5d2efed2e94a01b9f382709.zip
fixup: Hack up message list to be sorted ascendingtopic/asc_sort_imap
An attempt at making ascending or descending message list configurable. Seems to work for me, but a proper take on this might need to involve having to rethink what configuration options to present and how direct they map towards the operations happening under the hood.
Diffstat (limited to 'lib/threadbuilder.go')
-rw-r--r--lib/threadbuilder.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/threadbuilder.go b/lib/threadbuilder.go
index 334a846..a1954cb 100644
--- a/lib/threadbuilder.go
+++ b/lib/threadbuilder.go
@@ -145,16 +145,12 @@ func (builder *ThreadBuilder) sortThreads(threads []*types.Thread, orderedUids [
// RebuildUids rebuilds the uids from the given slice of threads
func (builder *ThreadBuilder) RebuildUids(threads []*types.Thread) {
uids := make([]uint32, 0, len(threads))
- for i := len(threads) - 1; i >= 0; i-- {
+ for i := 0; i < len(threads); i++ {
threads[i].Walk(func(t *types.Thread, level int, currentErr error) error {
uids = append(uids, t.Uid)
return nil
})
}
- // copy in reverse as msgList displays backwards
- for i, j := 0, len(uids)-1; i < j; i, j = i+1, j-1 {
- uids[i], uids[j] = uids[j], uids[i]
- }
builder.threadedUids = uids
}