From 7d2b0f579dd307fe541401efcf79d318367ad5e2 Mon Sep 17 00:00:00 2001 From: Koni Marti Date: Sat, 19 Mar 2022 21:51:05 +0100 Subject: [PATCH] store: fix deleting messages in filter mode fix deleting messages when in filter mode. Link: https://lists.sr.ht/~rjarry/aerc-devel/%3CCIO3IVSM2JUB.3L46NM6LJZ2KB%40Archetype%3E Reported-by: Moritz Poldrack Signed-off-by: Koni Marti Tested-by: Moritz Poldrack Acked-by: Robin Jarry --- lib/msgstore.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/msgstore.go b/lib/msgstore.go index ddc2d56..817a7b3 100644 --- a/lib/msgstore.go +++ b/lib/msgstore.go @@ -290,6 +290,14 @@ func (store *MessageStore) Update(msg types.WorkerMessage) { } store.results = newResults + var newFiltered []uint32 + for _, res := range store.filtered { + if _, deleted := toDelete[res]; !deleted { + newFiltered = append(newFiltered, res) + } + } + store.filtered = newFiltered + for _, thread := range store.Threads { thread.Walk(func(t *types.Thread, _ int, _ error) error { if _, deleted := toDelete[t.Uid]; deleted {