diff options
author | Koni Marti <koni.marti@gmail.com> | 2022-11-07 22:17:11 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-12-02 22:59:44 +0100 |
commit | b46e57324394dd1ca106d210463190ae80f743c8 (patch) | |
tree | f17b94865a61fadc2986dbe4e7751dfa9fe76ca4 /lib/msgstore.go | |
parent | ce664936fd0d8d4d69de50545b394877cfc76c0b (diff) | |
download | aerc-b46e57324394dd1ca106d210463190ae80f743c8.tar.gz |
store: fix server-side threads toggling
Fix server-side threads toggling that can sometimes cause the uids to be
out-of-sync with the threads. This patch ensures a consistent way of
handling the uids and threads in the store.
Fixes: https://todo.sr.ht/~rjarry/aerc/102
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib/msgstore.go')
-rw-r--r-- | lib/msgstore.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go index 4a68f808..31f6da28 100644 --- a/lib/msgstore.go +++ b/lib/msgstore.go @@ -236,9 +236,8 @@ func (store *MessageStore) Update(msg types.WorkerMessage) { case *types.DirectoryThreaded: newMap := make(map[uint32]*models.MessageInfo) - builder := NewThreadBuilder(store.iterFactory) - builder.RebuildUids(msg.Threads, store.reverseThreadOrder) - store.uids = builder.Uids() + store.builder = NewThreadBuilder(store.iterFactory) + store.builder.RebuildUids(msg.Threads, store.reverseThreadOrder) store.threads = msg.Threads for _, uid := range store.uids { |