aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/msgstore.go12
-rw-r--r--lib/threadbuilder.go3
2 files changed, 13 insertions, 2 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go
index 6710fa56..c02d8f4d 100644
--- a/lib/msgstore.go
+++ b/lib/msgstore.go
@@ -368,8 +368,16 @@ func (store *MessageStore) update(threads bool) {
if store.onUpdateDirs != nil {
store.onUpdateDirs()
}
- if store.BuildThreads() && store.ThreadedView() && threads {
- store.runThreadBuilder()
+ if store.ThreadedView() && threads {
+ switch {
+ case store.BuildThreads():
+ store.runThreadBuilder()
+ default:
+ if store.builder == nil {
+ store.builder = NewThreadBuilder(store.iterFactory)
+ }
+ store.builder.RebuildUids(store.Threads(), store.reverseThreadOrder)
+ }
}
}
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
})