aboutsummaryrefslogtreecommitdiffstats
path: root/lib/threadbuilder.go
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2022-12-07 13:38:04 -0600
committerRobin Jarry <robin@jarry.cc>2022-12-14 11:24:49 +0100
commitffc21baeacb587f66e58ef65ddfdd40b0be4a812 (patch)
tree595016e06f55fbca06597c06fe495f47c35c8f73 /lib/threadbuilder.go
parentfec207e92270f8ad176b85f43c46bc2926e1cd6c (diff)
downloadaerc-ffc21baeacb587f66e58ef65ddfdd40b0be4a812.tar.gz
threads: rebuild server threads when updating threads
The addition of the iterator factory added a thread builder when using server side threads. A conditional for returning UIDs when selecting messages would check for a not-nil store.builder, and return UIDs from the thread builder. When using server side threads, there was no mechanism to update the threads after a message deletion or move, so store.Uids() would return a stale set of UIDs. This would allow the user to "select" a deleted email (the cursor would disappear). Add an update mechanism for the threads if server side threads are enabled. When building thread UIDs, check for deleted or hidden threads. Fixes: https://todo.sr.ht/~rjarry/aerc/123 Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Inwit <inwit@sindominio.net>
Diffstat (limited to 'lib/threadbuilder.go')
-rw-r--r--lib/threadbuilder.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/threadbuilder.go b/lib/threadbuilder.go
index 5a73397a..c2fee228 100644
--- a/lib/threadbuilder.go
+++ b/lib/threadbuilder.go
@@ -184,6 +184,9 @@ func (builder *ThreadBuilder) RebuildUids(threads []*types.Thread, inverse bool)
var threaduids []uint32
_ = iterT.Value().(*types.Thread).Walk(
func(t *types.Thread, level int, currentErr error) error {
+ if t.Deleted || t.Hidden {
+ return nil
+ }
threaduids = append(threaduids, t.Uid)
return nil
})